text: /**
   * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
   *
   * Copyright 2011-2014 Cesium Contributors
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *
   * Columbus View (Pat. Pend.)
   *
   * Portions licensed separately.
   * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
   */
  /**
  @license
  mersenne-twister.js - https://gist.github.com/banksean/300494
  
     Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
     All rights reserved.
  
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:
  
       1. Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
  
       2. Redistributions in binary form must reproduce the above copyright
          notice, this list of conditions and the following disclaimer in the
          documentation and/or other materials provided with the distribution.
  
       3. The names of its contributors may not be used to endorse or promote
          products derived from this software without specific prior written
          permission.
  
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
     LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
  
  !function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,o=r.TWO_PI;-(n+t)>e;)e+=o;if(-n>e)return-n;for(;e>n+t;)e-=o;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],o=t;e>=o;o++)n.push(r*o);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var o=new e;return r.setRandomNumberSeed=function(t){o=new e(t)},r.nextRandomNumber=function(){return o.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var a=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};a.fromSpherical=function(r,n){t(n)||(n=new a);var o=r.clock,i=r.cone,u=e(r.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(o),n.y=s*Math.sin(o),n.z=u*Math.cos(i),n},a.fromElements=function(e,r,n,o){return t(o)?(o.x=e,o.y=r,o.z=n,o):new a(e,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},a.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new a),o.x=r[n++],o.y=r[n++],o.z=r[n],o},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,s),a.normalize(t,c);var r=a.dot(s,c),n=a.magnitude(a.cross(s,c,s));return Math.atan2(n,r)};var l=new a;a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,l);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):r.y<=r.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},a.cross=function(e,t,r){var n=e.x,o=e.y,a=e.z,i=t.x,u=t.y,s=t.z,c=o*s-a*u,l=a*i-n*s,f=n*u-o*i;return r.x=c,r.y=l,r.z=f,r},a.fromDegrees=function(e,t,r,n,i){var u=o.toRadians(e),s=o.toRadians(t);return a.fromRadians(u,s,r,n,i)};var f=new a,m=new a,h=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(r,n,o,i,u){o=e(o,0);var s=t(i)?i.radiiSquared:h,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=a.normalize(f,f),a.multiplyComponents(s,f,m);var l=Math.sqrt(a.dot(f,m));return m=a.divideByScalar(m,l,m),f=a.multiplyByScalar(f,o,f),t(u)||(u=new a),a.add(m,f,u)},a.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),i=0;i<e.length;i++)n[i]=o.toRadians(e[i]);return a.fromRadiansArray(n,t,r)},a.fromRadiansArray=function(e,r,n){var o=e.length;t(n)?n.length=o/2:n=new Array(o/2);for(var i=0;o>i;i+=2){var u=e[i],s=e[i+1];n[i/2]=a.fromRadians(u,s,0,r,n[i/2])}return n},a.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),i=0;i<e.length;i+=3)n[i]=o.toRadians(e[i]),n[i+1]=o.toRadians(e[i+1]),n[i+2]=e[i+2];return a.fromRadiansArrayHeights(n,t,r)},a.fromRadiansArrayHeights=function(e,r,n){var o=e.length;t(n)?n.length=o/3:n=new Array(o/3);for(var i=0;o>i;i+=3){var u=e[i],s=e[i+1],c=e[i+2];n[i/3]=a.fromRadians(u,s,c,r,n[i/3])}return n},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var a=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return a.fromRadians=function(r,n,o,i){return o=e(o,0),t(i)?(i.longitude=r,i.latitude=n,i.height=o,i):new a(r,n,o)},a.fromDegrees=function(e,t,r,n){return e=o.toRadians(e),t=o.toRadians(t),a.fromRadians(e,t,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new a(e.longitude,e.latitude,e.height):void 0},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},a.ZERO=n(new a(0,0,0)),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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,a,i,u){"use strict";function s(t,n,o,a){n=r(n,0),o=r(o,0),a=r(a,0),t._radii=new e(n,o,a),t._radiiSquared=new e(n*n,o*o,a*a),t._radiiToTheFourth=new e(n*n*n*n,o*o*o*o,a*a*a*a),t._oneOverRadii=new e(0===n?0:1/n,0===o?0:1/o,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===o?0:1/(o*o),0===a?0:1/(a*a)),t._minimumRadius=Math.min(n,o,a),t._maximumRadius=Math.max(n,o,a),t._centerToleranceSquared=u.EPSILON1}var c=function(e,t,r){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,s(this,e,t,r)};o(c.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}}}),c.clone=function(t,r){if(!n(t))return void 0;var o=t._radii;return n(r)?(e.clone(o,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new c(o.x,o.y,o.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=i(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=i(new c(1,1,1)),c.MOON=i(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,r){var o=t.longitude,a=t.latitude,i=Math.cos(a),u=i*Math.cos(o),s=i*Math.sin(o),c=Math.sin(a);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var o=l,a=f;this.geodeticSurfaceNormalCartographic(t,o),e.multiplyComponents(this._radiiSquared,o,a);var i=Math.sqrt(e.dot(o,a));return e.divideByScalar(a,i,a),e.multiplyByScalar(o,t.height,o),n(r)||(r=new e),e.add(a,o,r)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};var m=new e,h=new e,d=new e;c.prototype.cartesianToCartographic=function(r,o){var a=this.scaleToGeodeticSurface(r,h);if(!n(a))return void 0;var i=this.geodeticSurfaceNormal(a,m),s=e.subtract(r,a,d),c=Math.atan2(i.y,i.x),l=Math.asin(i.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(o)?(o.longitude=c,o.latitude=l,o.height=f,o):new t(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);return t};var p=new e,y=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var o=t.x,a=t.y,i=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,m=o*o*c*c,h=a*a*l*l,d=i*i*f*f,v=m+h+d,g=Math.sqrt(1/v),E=e.multiplyByScalar(t,g,p);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(E,r):void 0;var C=this._oneOverRadiiSquared,S=C.x,w=C.y,A=C.z,x=y;x.x=2*E.x*S,x.y=2*E.y*w,x.z=2*E.z*A;var b,T,M,R,O,I,N,L,z,P,D,F=(1-g)*e.magnitude(t)/(.5*e.magnitude(x)),_=0;do{F-=_,M=1/(1+F*S),R=1/(1+F*w),O=1/(1+F*A),I=M*M,N=R*R,L=O*O,z=I*M,P=N*R,D=L*O,b=m*I+h*N+d*L-1,T=m*z*S+h*P*w+d*D*A;var B=-2*T;_=b/B}while(Math.abs(b)>u.EPSILON12);return n(r)?(r.x=o*M,r.y=a*R,r.z=i*O,r):new e(o*M,a*R,i*O)},c.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var o=t.x,a=t.y,i=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(o*o*u.x+a*a*u.y+i*i*u.z);return e.multiplyByScalar(t,s,r)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,o,a,i){"use strict";var u=function(e){this._ellipsoid=r(e,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var o=this._semimajorAxis,a=t.longitude*o,i=t.latitude*o,u=t.height;return n(r)?(r.x=a,r.y=i,r.z=u,r):new e(a,i,u)},u.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,a=e.x*o,i=e.y*o,u=e.z;return n(r)?(r.longitude=a,r.latitude=i,r.height=u,r):new t(a,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,a){"use strict";function i(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(h[r],m[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=a.EPSILON15,n=0,o=1,i=0;3>i;++i){var u=Math.abs(e[c.getElementIndex(h[i],m[i])]);u>n&&(o=i,n=u)}var s=1,l=0,f=m[o],d=h[o];if(Math.abs(e[c.getElementIndex(d,f)])>r){var p,y=e[c.getElementIndex(d,d)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(d,f)],E=(y-v)/2/g;p=0>E?-1/(-E+Math.sqrt(1+E*E)):1/(E+Math.sqrt(1+E*E)),s=1/Math.sqrt(1+p*p),l=p*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(d,d)]=s,t[c.getElementIndex(d,f)]=l,t[c.getElementIndex(f,d)]=-l,t}var c=function(e,r,n,o,a,i,u,s,c){this[0]=t(e,0),this[1]=t(o,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(a,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(i,0),this[8]=t(c,0)};c.clone=function(e,t){return r(e)?r(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 c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,o){return n=t(n,0),r(o)||(o=new c),o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],o[3]=e[n+3],o[4]=e[n+4],o[5]=e[n+5],o[6]=e[n+6],o[7]=e[n+7],o[8]=e[n+8],o},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,o=e.x*e.y,a=e.x*e.z,i=e.x*e.w,u=e.y*e.y,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,m=e.z*e.w,h=e.w*e.w,d=n-u-f+h,p=2*(o-m),y=2*(a+l),v=2*(o+m),g=-n+u-f+h,E=2*(s-i),C=2*(a-l),S=2*(s+i),w=-n-u+f+h;return r(t)?(t[0]=d,t[1]=v,t[2]=C,t[3]=p,t[4]=g,t[5]=S,t[6]=y,t[7]=E,t[8]=w,t):new c(d,p,y,v,g,E,C,S,w)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=o,t[6]=0,t[7]=-o,t[8]=n,t):new c(1,0,0,0,n,-o,0,o,n)},c.fromRotationY=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-o,t[3]=0,t[4]=1,t[5]=0,t[6]=o,t[7]=0,t[8]=n,t):new c(n,0,o,0,1,0,-o,0,n)},c.fromRotationZ=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new c(n,-o,0,o,n,0,0,0,1)},c.toArray=function(e,t){return r(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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,o=e[n],a=e[n+1],i=e[n+2];return r.x=o,r.y=a,r.z=i,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var o=3*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n},c.getRow=function(e,t,r){var n=e[t],o=e[t+3],a=e[t+6];return r.x=n,r.y=o,r.z=a,r},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],i=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=o,r[2]=a,r[3]=i,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=e[0]*n+e[3]*o+e[6]*a,u=e[1]*n+e[4]*o+e[7]*a,s=e[2]*n+e[5]*o+e[8]*a;return r.x=i,r.y=u,r.z=s,r},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return 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},c.transpose=function(e,t){var r=e[0],n=e[3],o=e[6],a=e[1],i=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=o,t[3]=a,t[4]=i,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var m=[1,0,0],h=[2,2,1],d=new c,p=new c;return c.computeEigenDecomposition=function(e,t){var n=a.EPSILON20,o=10,l=0,f=0;r(t)||(t={});for(var m=t.unitary=c.clone(c.IDENTITY,t.unitary),h=t.diagonal=c.clone(e,t.diagonal),y=n*i(h);o>f&&u(h)>y;)s(h,d),c.transpose(d,p),c.multiply(h,d,h),c.multiply(p,h,h),c.multiply(m,d,m),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],o=e[1],a=e[4],i=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*i)+o*(s*n-r*c)+u*(r*i-a*n)},c.inverse=function(e,t){var r=e[0],o=e[1],i=e[2],u=e[3],s=e[4],l=e[5],f=e[6],m=e[7],h=e[8],d=c.determinant(e);if(Math.abs(d)<=a.EPSILON15)throw new n("matrix is not invertible");t[0]=s*h-m*l,t[1]=m*i-o*h,t[2]=o*l-s*i,t[3]=f*l-u*h,t[4]=r*h-f*i,t[5]=u*i-r*l,t[6]=u*m-f*s,t[7]=f*o-r*m,t[8]=r*s-u*o;var p=1/d;return c.multiplyByScalar(t,p,t)},c.equals=function(e,t){return e===t||r(e)&&r(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]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=o(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,o,a,i,u){"use strict";var s=function(e,r,n,o,a,i,u,s,c,l,f,m,h,d,p,y){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(c,0),this[3]=t(h,0),this[4]=t(r,0),this[5]=t(i,0),this[6]=t(l,0),this[7]=t(d,0),this[8]=t(n,0),this[9]=t(u,0),this[10]=t(f,0),this[11]=t(p,0),this[12]=t(o,0),this[13]=t(s,0),this[14]=t(m,0),this[15]=t(y,0)};s.packedLength=16,s.pack=function(e,r,n){n=t(n,0),r[n++]=e[0],r[n++]=e[1],r[n++]=e[2],r[n++]=e[3],r[n++]=e[4],r[n++]=e[5],r[n++]=e[6],r[n++]=e[7],r[n++]=e[8],r[n++]=e[9],r[n++]=e[10],r[n++]=e[11],r[n++]=e[12],r[n++]=e[13],r[n++]=e[14],r[n]=e[15]},s.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new s),o[0]=e[n++],o[1]=e[n++],o[2]=e[n++],o[3]=e[n++],o[4]=e[n++],o[5]=e[n++],o[6]=e[n++],o[7]=e[n++],o[8]=e[n++],o[9]=e[n++],o[10]=e[n++],o[11]=e[n++],o[12]=e[n++],o[13]=e[n++],o[14]=e[n++],o[15]=e[n],o},s.clone=function(e,t){return r(e)?r(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 s(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]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new s(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])},s.fromRotationTranslation=function(e,t,n){return r(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new s(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},s.fromTranslationQuaternionRotationScale=function(e,t,n,o){r(o)||(o=new s);var a=n.x,i=n.y,u=n.z,c=t.x*t.x,l=t.x*t.y,f=t.x*t.z,m=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,y=t.z*t.z,v=t.z*t.w,g=t.w*t.w,E=c-h-y+g,C=2*(l-v),S=2*(f+p),w=2*(l+v),A=-c+h-y+g,x=2*(d-m),b=2*(f-p),T=2*(d+m),M=-c-h+y+g;return o[0]=E*a,o[1]=w*a,o[2]=b*a,o[3]=0,o[4]=C*i,o[5]=A*i,o[6]=T*i,o[7]=0,o[8]=S*u,o[9]=x*u,o[10]=M*u,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o},s.fromTranslation=function(e,t){return s.fromRotationTranslation(i.IDENTITY,e,t)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new s(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new s(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,l=new e,f=new e;s.fromCamera=function(t,n){var o=t.eye,a=t.target,i=t.up;e.normalize(e.subtract(a,o,c),c),e.normalize(e.cross(c,i,l),l),e.normalize(e.cross(l,c,f),f);var u=l.x,m=l.y,h=l.z,d=c.x,p=c.y,y=c.z,v=f.x,g=f.y,E=f.z,C=o.x,S=o.y,w=o.z,A=u*-C+m*-S+h*-w,x=v*-C+g*-S+E*-w,b=d*C+p*S+y*w;return r(n)?(n[0]=u,n[1]=v,n[2]=-d,n[3]=0,n[4]=m,n[5]=g,n[6]=-p,n[7]=0,n[8]=h,n[9]=E,n[10]=-y,n[11]=0,n[12]=A,n[13]=x,n[14]=b,n[15]=1,n):new s(u,m,h,A,v,g,E,x,-d,-p,-y,b,0,0,0,1)},s.computePerspectiveFieldOfView=function(e,t,r,n,o){var a=Math.tan(.5*e),i=1/a,u=i/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,o[15]=0,o},s.computeOrthographicOffCenter=function(e,t,r,n,o,a,i){var u=1/(t-e),s=1/(n-r),c=1/(a-o),l=-(t+e)*u,f=-(n+r)*s,m=-(a+o)*c;return u*=2,s*=2,c*=-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]=c,i[11]=0,i[12]=l,i[13]=f,i[14]=m,i[15]=1,i},s.computePerspectiveOffCenter=function(e,t,r,n,o,a,i){var u=2*o/(t-e),s=2*o/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(a+o)/(a-o),m=-1,h=-2*a*o/(a-o);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]=c,i[9]=l,i[10]=f,i[11]=m,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},s.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,a){var i=2*o/(t-e),u=2*o/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,m=-2*o;return a[0]=i,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=c,a[10]=l,a[11]=f,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a},s.computeViewportTransformation=function(e,r,n,o){e=t(e,t.EMPTY_OBJECT);var a=t(e.x,0),i=t(e.y,0),u=t(e.width,0),s=t(e.height,0);r=t(r,0),n=t(n,1);var c=.5*u,l=.5*s,f=.5*(n-r),m=c,h=l,d=f,p=a+c,y=i+l,v=r+f,g=1;return o[0]=m,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=d,o[11]=0,o[12]=p,o[13]=y,o[14]=v,o[15]=g,o},s.toArray=function(e,t){return r(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):[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]]},s.getElementIndex=function(e,t){return 4*e+t},s.getColumn=function(e,t,r){var n=4*t,o=e[n],a=e[n+1],i=e[n+2],u=e[n+3];return r.x=o,r.y=a,r.z=i,r.w=u,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var o=4*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n[o+3]=r.w,n},s.getRow=function(e,t,r){var n=e[t],o=e[t+4],a=e[t+8],i=e[t+12];return r.x=n,r.y=o,r.z=a,r.w=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var m=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),r};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,r){var n=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],m=e[9],h=e[10],d=e[11],p=e[12],y=e[13],v=e[14],g=e[15],E=t[0],C=t[1],S=t[2],w=t[3],A=t[4],x=t[5],b=t[6],T=t[7],M=t[8],R=t[9],O=t[10],I=t[11],N=t[12],L=t[13],z=t[14],P=t[15],D=n*E+u*C+f*S+p*w,F=o*E+s*C+m*S+y*w,_=a*E+c*C+h*S+v*w,B=i*E+l*C+d*S+g*w,U=n*A+u*x+f*b+p*T,G=o*A+s*x+m*b+y*T,q=a*A+c*x+h*b+v*T,k=i*A+l*x+d*b+g*T,W=n*M+u*R+f*O+p*I,Y=o*M+s*R+m*O+y*I,V=a*M+c*R+h*O+v*I,H=i*M+l*R+d*O+g*I,j=n*N+u*L+f*z+p*P,K=o*N+s*L+m*z+y*P,Z=a*N+c*L+h*z+v*P,X=i*N+l*L+d*z+g*P;return r[0]=D,r[1]=F,r[2]=_,r[3]=B,r[4]=U,r[5]=G,r[6]=q,r[7]=k,r[8]=W,r[9]=Y,r[10]=V,r[11]=H,r[12]=j,r[13]=K,r[14]=Z,r[15]=X,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},s.multiplyTransformation=function(e,t,r){var n=e[0],o=e[1],a=e[2],i=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],m=e[12],h=e[13],d=e[14],p=t[0],y=t[1],v=t[2],g=t[4],E=t[5],C=t[6],S=t[8],w=t[9],A=t[10],x=t[12],b=t[13],T=t[14],M=n*p+i*y+c*v,R=o*p+u*y+l*v,O=a*p+s*y+f*v,I=n*g+i*E+c*C,N=o*g+u*E+l*C,L=a*g+s*E+f*C,z=n*S+i*w+c*A,P=o*S+u*w+l*A,D=a*S+s*w+f*A,F=n*x+i*b+c*T+m,_=o*x+u*b+l*T+h,B=a*x+s*b+f*T+d;return r[0]=M,r[1]=R,r[2]=O,r[3]=0,r[4]=I,r[5]=N,r[6]=L,r[7]=0,r[8]=z,r[9]=P,r[10]=D,r[11]=0,r[12]=F,r[13]=_,r[14]=B,r[15]=1,r},s.multiplyByTranslation=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=n*e[0]+o*e[4]+a*e[8]+e[12],u=n*e[1]+o*e[5]+a*e[9]+e[13],s=n*e[2]+o*e[6]+a*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};var d=new e;return s.multiplyByUniformScale=function(e,t,r){return d.x=t,d.y=t,d.z=t,s.multiplyByScale(e,d,r)},s.multiplyByScale=function(e,t,r){var n=t.x,o=t.y,a=t.z;return 1===n&&1===o&&1===a?s.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=0,r[8]=a*e[8],r[9]=a*e[9],r[10]=a*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},s.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=t.w,u=e[0]*n+e[4]*o+e[8]*a+e[12]*i,s=e[1]*n+e[5]*o+e[9]*a+e[13]*i,c=e[2]*n+e[6]*o+e[10]*a+e[14]*i,l=e[3]*n+e[7]*o+e[11]*a+e[15]*i;return r.x=u,r.y=s,r.z=c,r.w=l,r},s.multiplyByPointAsVector=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=e[0]*n+e[4]*o+e[8]*a,u=e[1]*n+e[5]*o+e[9]*a,s=e[2]*n+e[6]*o+e[10]*a;return r.x=i,r.y=u,r.z=s,r
  },s.multiplyByPoint=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=e[0]*n+e[4]*o+e[8]*a+e[12],u=e[1]*n+e[5]*o+e[9]*a+e[13],s=e[2]*n+e[6]*o+e[10]*a+e[14];return r.x=i,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},s.negate=function(e,t){return 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},s.transpose=function(e,t){var r=e[1],n=e[2],o=e[3],a=e[6],i=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=i,t[14]=u,t[15]=e[15],t},s.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},s.equals=function(e,t){return e===t||r(e)&&r(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]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},s.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},s.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},s.inverse=function(e,t){var r=e[0],n=e[4],o=e[8],i=e[12],s=e[1],c=e[5],l=e[9],f=e[13],m=e[2],h=e[6],d=e[10],p=e[14],y=e[3],v=e[7],g=e[11],E=e[15],C=d*E,S=p*g,w=h*E,A=p*v,x=h*g,b=d*v,T=m*E,M=p*y,R=m*g,O=d*y,I=m*v,N=h*y,L=C*c+A*l+x*f-(S*c+w*l+b*f),z=S*s+T*l+O*f-(C*s+M*l+R*f),P=w*s+M*c+I*f-(A*s+T*c+N*f),D=b*s+R*c+N*l-(x*s+O*c+I*l),F=S*n+w*o+b*i-(C*n+A*o+x*i),_=C*r+M*o+R*i-(S*r+T*o+O*i),B=A*r+T*n+N*i-(w*r+M*n+I*i),U=x*r+O*n+I*o-(b*r+R*n+N*o);C=o*f,S=i*l,w=n*f,A=i*c,x=n*l,b=o*c,T=r*f,M=i*s,R=r*l,O=o*s,I=r*c,N=n*s;var G=C*v+A*g+x*E-(S*v+w*g+b*E),q=S*y+T*g+O*E-(C*y+M*g+R*E),k=w*y+M*v+I*E-(A*y+T*v+N*E),W=b*y+R*v+N*g-(x*y+O*v+I*g),Y=w*d+b*p+S*h-(x*p+C*h+A*d),V=R*p+C*m+M*d-(T*d+O*p+S*m),H=T*h+N*p+A*m-(I*p+w*m+M*h),j=I*d+x*m+O*h-(R*h+N*d+b*m),K=r*L+n*z+o*P+i*D;if(Math.abs(K)<a.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return K=1/K,t[0]=L*K,t[1]=z*K,t[2]=P*K,t[3]=D*K,t[4]=F*K,t[5]=_*K,t[6]=B*K,t[7]=U*K,t[8]=G*K,t[9]=q*K,t[10]=k*K,t[11]=W*K,t[12]=Y*K,t[13]=V*K,t[14]=H*K,t[15]=j*K,t},s.inverseTransformation=function(e,t){var r=e[0],n=e[1],o=e[2],a=e[4],i=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],m=e[13],h=e[14],d=-r*f-n*m-o*h,p=-a*f-i*m-u*h,y=-s*f-c*m-l*h;return t[0]=r,t[1]=a,t[2]=s,t[3]=0,t[4]=n,t[5]=i,t[6]=c,t[7]=0,t[8]=o,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=y,t[15]=1,t},s.IDENTITY=o(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.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]+")"},s}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,o,a,i){"use strict";var u=function(e,r,n,o){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(o,0)};u.fromDegrees=function(e,n,o,a,s){return e=i.toRadians(t(e,0)),n=i.toRadians(t(n,0)),o=i.toRadians(t(o,0)),a=i.toRadians(t(a,0)),r(s)?(s.west=e,s.south=n,s.east=o,s.north=a,s):new u(e,n,o,a)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),a=Math.min(a,l.latitude),i=Math.max(i,l.latitude)}return r(t)?(t.west=n,t.south=a,t.east=o,t.north=i,t):new u(n,a,o,i)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new u),o.west=e[n++],o.south=e[n++],o.east=e[n++],o.north=e[n],o},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var o=t.east,a=t.west,u=.5*(a+o);return a>o&&(u=i.negativePiToPi(u+i.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var o=Math.max(e.west,t.west),a=Math.max(e.south,t.south),i=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=o,n.south=a,n.east=i,n.north=s,n):new u(o,a,i,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,a,u){n=t(n,o.WGS84),a=t(a,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,m=e.east,h=e.west,d=s;d.height=a,d.longitude=h,d.latitude=l,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.longitude=m,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.latitude=f,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.longitude=h,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.latitude=0>l?l:f>0?f:0;for(var p=1;8>p;++p){var y=-Math.PI+p*i.PI_OVER_TWO;y>h&&m>y&&(d.longitude=y,u[c]=n.cartographicToCartesian(d,u[c]),c++)}return 0===d.latitude&&(d.longitude=h,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.longitude=m,u[c]=n.cartographicToCartesian(d,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-i.PI_OVER_TWO,Math.PI,i.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,o,a,i,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},m=new e,h=new e,d=new e,p=new e,y=new e,v=new e,g=new e,E=new e,C=new e,S=new e,w=new e,A=new e;f.fromPoints=function(t,r){if(n(r)||(r=new f),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var o=e.clone(t[0],g),a=e.clone(o,m),i=e.clone(o,h),u=e.clone(o,d),s=e.clone(o,p),c=e.clone(o,y),l=e.clone(o,v),x=t.length,b=1;x>b;b++){e.clone(t[b],o);var T=o.x,M=o.y,R=o.z;T<a.x&&e.clone(o,a),T>s.x&&e.clone(o,s),M<i.y&&e.clone(o,i),M>c.y&&e.clone(o,c),R<u.z&&e.clone(o,u),R>l.z&&e.clone(o,l)}var O=e.magnitudeSquared(e.subtract(s,a,E)),I=e.magnitudeSquared(e.subtract(c,i,E)),N=e.magnitudeSquared(e.subtract(l,u,E)),L=a,z=s,P=O;I>P&&(P=I,L=i,z=c),N>P&&(P=N,L=u,z=l);var D=C;D.x=.5*(L.x+z.x),D.y=.5*(L.y+z.y),D.z=.5*(L.z+z.z);var F=e.magnitudeSquared(e.subtract(z,D,E)),_=Math.sqrt(F),B=S;B.x=a.x,B.y=i.y,B.z=u.z;var U=w;U.x=s.x,U.y=c.y,U.z=l.z;var G=e.multiplyByScalar(e.add(B,U,E),.5,A),q=0;for(b=0;x>b;b++){e.clone(t[b],o);var k=e.magnitude(e.subtract(o,G,E));k>q&&(q=k);var W=e.magnitudeSquared(e.subtract(o,D,E));if(W>F){var Y=Math.sqrt(W);_=.5*(_+Y),F=_*_;var V=Y-_;D.x=(_*D.x+V*o.x)/Y,D.y=(_*D.y+V*o.y)/Y,D.z=(_*D.z+V*o.z)/Y}}return q>_?(e.clone(D,r.center),r.radius=_):(e.clone(G,r.center),r.radius=q),r};var x=new i,b=new e,T=new e,M=new t,R=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,o,a,i,u){if(n(u)||(u=new f),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;o=r(o,x),l.southwest(t,M),M.height=a,l.northeast(t,R),R.height=i;var s=o.project(M,b),c=o.project(R,T),m=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(m*m+h*h+d*d);var p=u.center;return p.x=s.x+.5*m,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var O=[];f.fromRectangle3D=function(e,t,o,i){t=r(t,a.WGS84),o=r(o,0);var u;return n(e)&&(u=l.subsample(e,t,o,O)),f.fromPoints(u,i)},f.fromVertices=function(t,o,a,i){if(n(i)||(i=new f),!n(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;o=r(o,e.ZERO),a=r(a,3);var u=g;u.x=t[0]+o.x,u.y=t[1]+o.y,u.z=t[2]+o.z;for(var s=e.clone(u,m),c=e.clone(u,h),l=e.clone(u,d),x=e.clone(u,p),b=e.clone(u,y),T=e.clone(u,v),M=t.length,R=0;M>R;R+=a){var O=t[R]+o.x,I=t[R+1]+o.y,N=t[R+2]+o.z;u.x=O,u.y=I,u.z=N,O<s.x&&e.clone(u,s),O>x.x&&e.clone(u,x),I<c.y&&e.clone(u,c),I>b.y&&e.clone(u,b),N<l.z&&e.clone(u,l),N>T.z&&e.clone(u,T)}var L=e.magnitudeSquared(e.subtract(x,s,E)),z=e.magnitudeSquared(e.subtract(b,c,E)),P=e.magnitudeSquared(e.subtract(T,l,E)),D=s,F=x,_=L;z>_&&(_=z,D=c,F=b),P>_&&(_=P,D=l,F=T);var B=C;B.x=.5*(D.x+F.x),B.y=.5*(D.y+F.y),B.z=.5*(D.z+F.z);var U=e.magnitudeSquared(e.subtract(F,B,E)),G=Math.sqrt(U),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var k=w;k.x=x.x,k.y=b.y,k.z=T.z;var W=e.multiplyByScalar(e.add(q,k,E),.5,A),Y=0;for(R=0;M>R;R+=a){u.x=t[R]+o.x,u.y=t[R+1]+o.y,u.z=t[R+2]+o.z;var V=e.magnitude(e.subtract(u,W,E));V>Y&&(Y=V);var H=e.magnitudeSquared(e.subtract(u,B,E));if(H>U){var j=Math.sqrt(H);G=.5*(G+j),U=G*G;var K=j-G;B.x=(G*B.x+K*u.x)/j,B.y=(G*B.y+K*u.y)/j,B.z=(G*B.z+K*u.z)/j}}return Y>G?(e.clone(B,i.center),i.radius=G):(e.clone(W,i.center),i.radius=Y),i},f.fromCornerPoints=function(t,r,o){n(o)||(o=new f);var a=o.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),o.radius=e.distance(a,r),o},f.fromEllipsoid=function(t,r){return n(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var o=e.center;t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n]=e.radius},f.unpack=function(e,t,o){t=r(t,0),n(o)||(o=new f);var a=o.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],o.radius=e[t],o};var I=new e,N=new e;f.union=function(t,r,o){n(o)||(o=new f);var a=t.center,i=r.center;e.add(a,i,N);var u=e.multiplyByScalar(N,.5,N),s=e.magnitude(e.subtract(a,u,I))+t.radius,c=e.magnitude(e.subtract(i,u,I))+r.radius;return o.radius=Math.max(s,c),e.clone(u,o.center),o};var L=new e;f.expand=function(t,r,n){n=f.clone(t,n);var o=e.magnitude(e.subtract(r,n.center,L));return o>n.radius&&(n.radius=o),n},f.intersect=function(t,r){var n=t.center,o=t.radius,a=e.dot(r,n)+r.w;return-o>a?u.OUTSIDE:o>a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var z=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var P=new e;f.computePlaneDistances=function(t,r,o,a){n(a)||(a=new s);var i=e.subtract(t.center,r,P),u=e.multiplyByScalar(o,e.dot(o,i),P),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var D=new e,F=new e,_=new e,B=new e,U=new e,G=new t,q=new Array(8),k=0;8>k;++k)q[k]=new e;var W=new i;return f.projectTo2D=function(t,n,o){n=r(n,W);var a=n.ellipsoid,i=t.center,u=t.radius,s=a.geodeticSurfaceNormal(i,D),c=e.cross(e.UNIT_Z,s,F);e.normalize(c,c);var l=e.cross(s,c,_);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var m=e.negate(l,U),h=e.negate(c,B),d=q,p=d[0];e.add(s,l,p),e.add(p,c,p),p=d[1],e.add(s,l,p),e.add(p,h,p),p=d[2],e.add(s,m,p),e.add(p,h,p),p=d[3],e.add(s,m,p),e.add(p,c,p),e.negate(s,s),p=d[4],e.add(s,l,p),e.add(p,c,p),p=d[5],e.add(s,l,p),e.add(p,h,p),p=d[6],e.add(s,m,p),e.add(p,h,p),p=d[7],e.add(s,m,p),e.add(p,c,p);for(var y=d.length,v=0;y>v;++v){var g=d[v];e.add(i,g,g);var E=a.cartesianToCartographic(g,G);n.project(E,g)}o=f.fromPoints(d,o),i=o.center;var C=i.x,S=i.y,w=i.z;return i.x=w,i.y=C,i.z=S,o},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},o={};return t(o,{element:{get:function(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var o,a=["webkit","moz","o","ms","khtml"],i=0,u=a.length;u>i;++i){var s=a[i];o=s+"RequestFullscreen","function"==typeof t[o]?(n.requestFullscreen=o,r=!0):(o=s+"RequestFullScreen","function"==typeof t[o]&&(n.requestFullscreen=o,r=!0)),o=s+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=s+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=s+"FullscreenEnabled",e(document[o])?n.fullscreenEnabled=o:(o=s+"FullScreenEnabled",e(document[o])&&(n.fullscreenEnabled=o)),o=s+"FullscreenElement",e(document[o])?n.fullscreenElement=o:(o=s+"FullScreenElement",e(document[o])&&(n.fullscreenElement=o)),o=s+"fullscreenchange",e(document["on"+o])&&("ms"===s&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=s+"fullscreenerror",e(document["on"+o])&&("ms"===s&&(o="MSFullscreenError"),n.fullscreenerror=o)}return r},o.requestFullscreen=function(e){o.supportsFullscreen()&&e[n.requestFullscreen]()},o.exitFullscreen=function(){o.supportsFullscreen()&&document[n.exitFullscreen]()},o}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;n>r;++r)t[r]=parseInt(t[r],10);return t}function o(){if(!t(m)){var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null===e?m=!1:(m=!0,h=n(e[1]))}return m}function a(){return o()&&h}function i(){if(!t(d))if(o()||!/ Safari\/[\.0-9]+/.test(navigator.userAgent))d=!1;else{var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null===e?d=!1:(d=!0,p=n(e[1]))}return d}function u(){return i()&&p}function s(){if(!t(y)){var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null===e?y=!1:(y=!0,v=n(e[1]),v.isNightly=!!e[2])}return y}function c(){return s()&&v}function l(){if(!t(g)){var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(g=!0,E=n(e[1]))):"Netscape"===navigator.appName?(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(g=!0,E=n(e[1]))):g=!1}return g}function f(){return l()&&E}var m,h,d,p,y,v,g,E,C={isChrome:o,chromeVersion:a,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return C.supportsFullscreen=function(){return r.supportsFullscreen()},C.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},C}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,r,n,o,a){"use strict";function i(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+6*(t-e)*(2/3-r):e}var u=function(t,r,n,o){this.red=e(t,1),this.green=e(r,1),this.blue=e(n,1),this.alpha=e(o,1)};u.fromCartesian4=function(e,r){return t(r)?(r.red=e.x,r.green=e.y,r.blue=e.z,r.alpha=e.w,r):new u(e.x,e.y,e.z,e.w)},u.fromBytes=function(t,r,n,o){return t=u.byteToFloat(e(t,255)),r=u.byteToFloat(e(r,255)),n=u.byteToFloat(e(n,255)),o=u.byteToFloat(e(o,255)),new u(t,r,n,o)};var s,c,l;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),c=new Uint32Array(s),l=new Uint8Array(s)),u.fromRgba=function(e){return c[0]=e,u.fromBytes(l[0],l[1],l[2],l[3])},u.fromHsl=function(t,r,n,o){t=e(t,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var a=n,s=n,c=n;if(0!==r){var l;l=.5>n?n*(1+r):n+r-n*r;var f=2*n-l;a=i(f,l,t+1/3),s=i(f,l,t),c=i(f,l,t-1/3)}return new u(a,s,c,o)},u.fromRandom=function(r,n){r=e(r,e.EMPTY_OBJECT);var o=r.red;if(!t(o)){var i=e(r.minimumRed,0),s=e(r.maximumRed,1);o=i+a.nextRandomNumber()*(s-i)}var c=r.green;if(!t(c)){var l=e(r.minimumGreen,0),f=e(r.maximumGreen,1);c=l+a.nextRandomNumber()*(f-l)}var m=r.blue;if(!t(m)){var h=e(r.minimumBlue,0),d=e(r.maximumBlue,1);m=h+a.nextRandomNumber()*(d-h)}var p=r.alpha;if(!t(p)){var y=e(r.minimumAlpha,0),v=e(r.maximumAlpha,1);p=y+a.nextRandomNumber()*(v-y)}return t(n)?(n.red=o,n.green=c,n.blue=m,n.alpha=p,n):new u(o,c,m,p)};var f=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,m=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,h=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,d=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r){var n=u[r.toUpperCase()];if(t(n))return u.clone(n);var o=f.exec(r);return null!==o?new u(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=m.exec(r),null!==o?new u(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=h.exec(r),null!==o?new u(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(e(o[4],"1.0"))):(o=d.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0"))):void 0)))},u.packedLength=4,u.pack=function(t,r,n){n=e(n,0),r[n++]=t.red,r[n++]=t.green,r[n++]=t.blue,r[n]=t.alpha},u.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new u),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},u.byteToFloat=function(e){return e/255},u.floatToByte=function(e){return 1===e?255:0|256*e},u.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new u(e.red,e.green,e.blue,e.alpha):void 0},u.equals=function(e,r){return e===r||t(e)&&t(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,r){return this===e||t(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var e=u.floatToByte(this.red),t=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},u.prototype.toBytes=function(e){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),o=u.floatToByte(this.blue),a=u.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=n,e[2]=o,e[3]=a,e):[r,n,o,a]},u.prototype.toRgba=function(){return l[0]=u.floatToByte(this.red),l[1]=u.floatToByte(this.green),l[2]=u.floatToByte(this.blue),l[3]=u.floatToByte(this.alpha),c[0]},u.ALICEBLUE=o(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=o(u.fromCssColorString("#FAEBD7")),u.AQUA=o(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=o(u.fromCssColorString("#7FFFD4")),u.AZURE=o(u.fromCssColorString("#F0FFFF")),u.BEIGE=o(u.fromCssColorString("#F5F5DC")),u.BISQUE=o(u.fromCssColorString("#FFE4C4")),u.BLACK=o(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=o(u.fromCssColorString("#FFEBCD")),u.BLUE=o(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=o(u.fromCssColorString("#8A2BE2")),u.BROWN=o(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=o(u.fromCssColorString("#DEB887")),u.CADETBLUE=o(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=o(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=o(u.fromCssColorString("#D2691E")),u.CORAL=o(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=o(u.fromCssColorString("#6495ED")),u.CORNSILK=o(u.fromCssColorString("#FFF8DC")),u.CRIMSON=o(u.fromCssColorString("#DC143C")),u.CYAN=o(u.fromCssColorString("#00FFFF")),u.DARKBLUE=o(u.fromCssColorString("#00008B")),u.DARKCYAN=o(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=o(u.fromCssColorString("#B8860B")),u.DARKGRAY=o(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=o(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=o(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=o(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=o(u.fromCssColorString("#556B2F")),u.DARKORANGE=o(u.fromCssColorString("#FF8C00")),u.DARKORCHID=o(u.fromCssColorString("#9932CC")),u.DARKRED=o(u.fromCssColorString("#8B0000")),u.DARKSALMON=o(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=o(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=o(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=o(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=o(u.fromCssColorString("#00CED1")),u.DARKVIOLET=o(u.fromCssColorString("#9400D3")),u.DEEPPINK=o(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=o(u.fromCssColorString("#00BFFF")),u.DIMGRAY=o(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=o(u.fromCssColorString("#1E90FF")),u.FIREBRICK=o(u.fromCssColorString("#B22222")),u.FLORALWHITE=o(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=o(u.fromCssColorString("#228B22")),u.FUSCHIA=o(u.fromCssColorString("#FF00FF")),u.GAINSBORO=o(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=o(u.fromCssColorString("#F8F8FF")),u.GOLD=o(u.fromCssColorString("#FFD700")),u.GOLDENROD=o(u.fromCssColorString("#DAA520")),u.GRAY=o(u.fromCssColorString("#808080")),u.GREEN=o(u.fromCssColorString("#008000")),u.GREENYELLOW=o(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=o(u.fromCssColorString("#F0FFF0")),u.HOTPINK=o(u.fromCssColorString("#FF69B4")),u.INDIANRED=o(u.fromCssColorString("#CD5C5C")),u.INDIGO=o(u.fromCssColorString("#4B0082")),u.IVORY=o(u.fromCssColorString("#FFFFF0")),u.KHAKI=o(u.fromCssColorString("#F0E68C")),u.LAVENDER=o(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=o(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=o(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=o(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=o(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=o(u.fromCssColorString("#F08080")),u.LIGHTCYAN=o(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=o(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=o(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=o(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=o(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=o(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=o(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=o(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=o(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=o(u.fromCssColorString("#FFFFE0")),u.LIME=o(u.fromCssColorString("#00FF00")),u.LIMEGREEN=o(u.fromCssColorString("#32CD32")),u.LINEN=o(u.fromCssColorString("#FAF0E6")),u.MAGENTA=o(u.fromCssColorString("#FF00FF")),u.MAROON=o(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=o(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=o(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=o(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=o(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=o(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=o(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=o(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=o(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=o(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=o(u.fromCssColorString("#191970")),u.MINTCREAM=o(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=o(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=o(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=o(u.fromCssColorString("#FFDEAD")),u.NAVY=o(u.fromCssColorString("#000080")),u.OLDLACE=o(u.fromCssColorString("#FDF5E6")),u.OLIVE=o(u.fromCssColorString("#808000")),u.OLIVEDRAB=o(u.fromCssColorString("#6B8E23")),u.ORANGE=o(u.fromCssColorString("#FFA500")),u.ORANGERED=o(u.fromCssColorString("#FF4500")),u.ORCHID=o(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=o(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=o(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=o(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=o(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=o(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=o(u.fromCssColorString("#FFDAB9")),u.PERU=o(u.fromCssColorString("#CD853F")),u.PINK=o(u.fromCssColorString("#FFC0CB")),u.PLUM=o(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=o(u.fromCssColorString("#B0E0E6")),u.PURPLE=o(u.fromCssColorString("#800080")),u.RED=o(u.fromCssColorString("#FF0000")),u.ROSYBROWN=o(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=o(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=o(u.fromCssColorString("#8B4513")),u.SALMON=o(u.fromCssColorString("#FA8072")),u.SANDYBROWN=o(u.fromCssColorString("#F4A460")),u.SEAGREEN=o(u.fromCssColorString("#2E8B57")),u.SEASHELL=o(u.fromCssColorString("#FFF5EE")),u.SIENNA=o(u.fromCssColorString("#A0522D")),u.SILVER=o(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=o(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=o(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=o(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=o(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=o(u.fromCssColorString("#00FF7F")),u.STEELBLUE=o(u.fromCssColorString("#4682B4")),u.TAN=o(u.fromCssColorString("#D2B48C")),u.TEAL=o(u.fromCssColorString("#008080")),u.THISTLE=o(u.fromCssColorString("#D8BFD8")),u.TOMATO=o(u.fromCssColorString("#FF6347")),u.TURQUOISE=o(u.fromCssColorString("#40E0D0")),u.VIOLET=o(u.fromCssColorString("#EE82EE")),u.WHEAT=o(u.fromCssColorString("#F5DEB3")),u.WHITE=o(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=o(u.fromCssColorString("#F5F5F5")),u.YELLOW=o(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=o(u.fromCssColorString("#9ACD32")),u}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,o){"use strict";if(!n.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,n,o,i){switch(o=e(o,0),i=e(i,(n.byteLength-o)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(n,o,i);case a.UNSIGNED_BYTE:return new Uint8Array(n,o,i);case a.SHORT:return new Int16Array(n,o,i);case a.UNSIGNED_SHORT:return new Uint16Array(n,o,i);case a.FLOAT:return new Float32Array(n,o,i);case a.DOUBLE:return new Float64Array(n,o,i);default:throw new r("componentDatatype is not a valid value.")}},o(a)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType,this.boundingSphere=t.boundingSphere};return n.computeNumberOfVertices=function(e){var n=-1;for(var o in e.attributes)if(e.attributes.hasOwnProperty(o)&&t(e.attributes[o])&&t(e.attributes[o].values)){var a=e.attributes[o],i=a.values.length/a.componentsPerAttribute;if(n!==i&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=i}return n},n}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var a=function(t,r){this.x=e(t,0),this.y=e(r,0)};a.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new a(e,r)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},a.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new a),o.x=r[n++],o.y=r[n],o},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y)},a.minimumComponent=function(e){return Math.min(e.x,e.y)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);
  return t.x=e.x/r,t.y=e.y/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,s),a.normalize(t,c),o.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,l);return a.abs(r,r),t=r.x<=r.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,o=new t,a=new t,i=function(i,u,s,c,l){r(l)||(l=new t);var f,m,h,d,p,y,v,g;r(u.z)?(f=t.subtract(s,u,n),m=t.subtract(c,u,o),h=t.subtract(i,u,a),d=t.dot(f,f),p=t.dot(f,m),y=t.dot(f,h),v=t.dot(m,m),g=t.dot(m,h)):(f=e.subtract(s,u,n),m=e.subtract(c,u,o),h=e.subtract(i,u,a),d=e.dot(f,f),p=e.dot(f,m),y=e.dot(f,h),v=e.dot(m,m),g=e.dot(m,h));var E=1/(d*v-p*p);return l.y=(v*y-p*g)*E,l.z=(d*g-p*y)*E,l.x=1-l.y-l.z,l};return i}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var o=function(t,r,n,o){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(o,0)};o.fromElements=function(e,r,n,a,i){return t(i)?(i.x=e,i.y=r,i.z=n,i.w=a,i):new o(e,r,n,a)},o.fromColor=function(e,r){return t(r)?(r.x=e.red,r.y=e.green,r.z=e.blue,r.w=e.alpha,r):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new o(e.x,e.y,e.z,e.w):void 0},o.packedLength=4,o.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},o.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new o),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return 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},o.add=function(e,t,r){return 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},o.subtract=function(e,t,r){return 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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var i=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,i),n=o.multiplyByScalar(e,1-r,n),o.add(i,n,n)};var u=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,u);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z&&e.w===r.w},o.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},o.ZERO=n(new o(0,0,0,0)),o.UNIT_X=n(new o(1,0,0,0)),o.UNIT_Y=n(new o(0,1,0,0)),o.UNIT_Z=n(new o(0,0,1,0)),o.UNIT_W=n(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,o){t(o)||(o=new r);var a=o.high,i=o.low;return r.encode(e.x,n),a.x=n.high,i.x=n.low,r.encode(e.y,n),a.y=n.high,i.y=n.low,r.encode(e.z,n),a.z=n.high,i.z=n.low,o};var o=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,o);var a=o.high,i=o.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=i.x,t[n+4]=i.y,t[n+5]=i.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n){"use strict";var o={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},r(o)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var o=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(o/Math.max(Math.abs(e),Math.abs(r)))<n?0:o}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,o){var a;if(0===e)return 0===n?[]:[-o/n];if(0===n){if(0===o)return[0,0];var i=Math.abs(o),u=Math.abs(e);if(u>i&&i/u<t.EPSILON14)return[0,0];if(i>u&&u/i<t.EPSILON14)return[];if(a=-o/e,0>a)return[];var s=Math.sqrt(a);return[-s,s]}if(0===o)return a=-n/e,0>a?[a,0]:[0,a];var c=n*n,l=4*e*o,f=r(c,-l,t.EPSILON14);if(0>f)return[];var m=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[m/e,o/m]:[o/m,m/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var o,a,i=e,u=t/3,s=r/3,c=n,l=i*s,f=u*c,m=u*u,h=s*s,d=i*s-m,p=i*c-u*s,y=u*c-h,v=4*d*y-p*p;if(0>v){var g,E,C;m*f>=l*h?(g=i,E=d,C=-2*u*d+i*p):(g=c,E=y,C=-c*p+2*s*y);var S=0>C?-1:1,w=-S*Math.abs(g)*Math.sqrt(-v);a=-C+w;var A=a/2,x=0>A?-Math.pow(-A,1/3):Math.pow(A,1/3),b=a===w?-x:-E/x;return o=0>=E?x+b:-C/(x*x+b*b+E),m*f>=l*h?[(o-u)/i]:[-c/(o+s)]}var T=d,M=-2*u*d+i*p,R=y,O=-c*p+2*s*y,I=Math.sqrt(v),N=Math.sqrt(3)/2,L=Math.abs(Math.atan2(i*I,-M)/3);o=2*Math.sqrt(-T);var z=Math.cos(L);a=o*z;var P=o*(-z/2-N*Math.sin(L)),D=a+P>2*u?a-u:P-u,F=i,_=D/F;L=Math.abs(Math.atan2(c*I,-O)/3),o=2*Math.sqrt(-R),z=Math.cos(L),a=o*z,P=o*(-z/2-N*Math.sin(L));var B=-c,U=2*s>a+P?a+s:P+s,G=B/U,q=F*U,k=-D*U-F*B,W=D*B,Y=(s*k-u*W)/(-u*k+s*q);return Y>=_?G>=_?G>=Y?[_,Y,G]:[_,G,Y]:[G,_,Y]:G>=_?[Y,_,G]:G>=Y?[Y,G,_]:[G,Y,_]}var n={};return n.computeDiscriminant=function(e,t,r,n){var o=e*e,a=t*t,i=r*r,u=n*n,s=18*e*t*r*n+a*i-27*o*u-4*(e*i*r+a*t*n);return s},n.computeRealRoots=function(e,n,o,a){var i,u;if(0===e)return t.computeRealRoots(n,o,a);if(0===n){if(0===o){if(0===a)return[0,0,0];u=-a/e;var s=0>u?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(i=t.computeRealRoots(e,0,o),0===i.Length?[0]:[i[0],0,i[1]]):r(e,0,o,a)}return 0===o?0===a?(u=-n/e,0>u?[u,0,0]:[0,0,u]):r(e,n,0,a):0===a?(i=t.computeRealRoots(e,n,o),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):r(e,n,o,a)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function o(t,o,a,i){var u=t*t,s=o-3*u/8,c=a-o*t/2+u*t/8,l=i-a*t/4+o*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var m=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var p,y=d[0],v=d[1];if(y>=0&&v>=0){var g=Math.sqrt(y),E=Math.sqrt(v);return[m-E,m-g,m+g,m+E]}if(y>=0&&0>v)return p=Math.sqrt(y),[m-p,m+p];if(0>y&&v>=0)return p=Math.sqrt(v),[m-p,m+p]}return[]}if(h>0){var C=Math.sqrt(h),S=(s+h-c/C)/2,w=(s+h+c/C)/2,A=n.computeRealRoots(1,C,S),x=n.computeRealRoots(1,-C,w);return 0!==A.length?(A[0]+=m,A[1]+=m,0!==x.length?(x[0]+=m,x[1]+=m,A[1]<=x[0]?[A[0],A[1],x[0],x[1]]:x[1]<=A[0]?[x[0],x[1],A[0],A[1]]:A[0]>=x[0]&&A[1]<=x[1]?[x[0],A[0],A[1],x[1]]:x[0]>=A[0]&&x[1]<=A[1]?[A[0],x[0],x[1],A[1]]:A[0]>x[0]&&A[0]<x[1]?[x[0],A[0],x[1],A[1]]:[A[0],x[0],A[1],x[1]]):A):0!==x.length?(x[0]+=m,x[1]+=m,x):[]}}return[]}function a(t,o,a,i){var u=a*a,s=o*o,c=t*t,l=-2*o,f=a*t+s-4*i,m=c*i-a*o*t+u,h=e.computeRealRoots(1,l,f,m);if(h.length>0){var d,p,y=h[0],v=o-y,g=v*v,E=t/2,C=v/2,S=g-4*i,w=g+4*Math.abs(i),A=c-4*y,x=c+4*Math.abs(y);if(0>y||A*w>S*x){var b=Math.sqrt(A);d=b/2,p=0===b?0:(t*C-a)/b}else{var T=Math.sqrt(S);d=0===T?0:(t*C-a)/T,p=T/2}var M,R;0===E&&0===d?(M=0,R=0):r.sign(E)===r.sign(d)?(M=E+d,R=y/M):(R=E-d,M=y/R);var O,I;0===C&&0===p?(O=0,I=0):r.sign(C)===r.sign(p)?(O=C+p,I=i/O):(I=C-p,O=i/I);var N=n.computeRealRoots(1,M,O),L=n.computeRealRoots(1,R,I);if(0!==N.length)return 0!==L.length?N[1]<=L[0]?[N[0],N[1],L[0],L[1]]:L[1]<=N[0]?[L[0],L[1],N[0],N[1]]:N[0]>=L[0]&&N[1]<=L[1]?[L[0],N[0],N[1],L[1]]:L[0]>=N[0]&&L[1]<=N[1]?[N[0],L[0],L[1],N[1]]:N[0]>L[0]&&N[0]<L[1]?[L[0],N[0],L[1],N[1]]:[N[0],L[0],N[1],L[1]]:N;if(0!==L.length)return L}return[]}var i={};return i.computeDiscriminant=function(e,t,r,n,o){var a=e*e,i=a*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,m=f*n,h=o*o,d=h*o,p=u*c*f-4*s*m-4*e*l*f+18*e*t*r*m-27*a*f*f+256*i*d+o*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*a*r*f)+h*(144*e*u*r-27*u*u-128*a*c-192*a*t*n);return p},i.computeRealRoots=function(t,n,i,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,i,u,s);var c=n/t,l=i/t,f=u/t,m=s/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>f?h+1:h,h+=0>m?h+1:h){case 0:return o(c,l,f,m);case 1:return a(c,l,f,m);case 2:return a(c,l,f,m);case 3:return o(c,l,f,m);case 4:return o(c,l,f,m);case 5:return a(c,l,f,m);case 6:return o(c,l,f,m);case 7:return o(c,l,f,m);case 8:return a(c,l,f,m);case 9:return o(c,l,f,m);case 10:return o(c,l,f,m);case 11:return a(c,l,f,m);case 12:return o(c,l,f,m);case 13:return o(c,l,f,m);case 14:return o(c,l,f,m);case 15:return o(c,l,f,m);default:return void 0}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,o){return r(o)||(o=new e),o=e.multiplyByScalar(t.direction,n,o),e.add(t.origin,o,o)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,o,a,i,u,s,c){"use strict";function l(t,n,o,i,u){u=r(u,!1);var s,c,l,f,m,h=t.origin,d=t.direction,p=e.subtract(o,n,y),S=e.subtract(i,n,v),w=e.cross(d,S,g),A=e.dot(p,w);if(u){if(A<a.EPSILON6)return void 0;if(s=e.subtract(h,n,E),l=e.dot(s,w),0>l||l>A)return void 0;if(c=e.cross(s,p,C),f=e.dot(d,c),0>f||l+f>A)return void 0;m=e.dot(S,c)/A}else{if(Math.abs(A)<a.EPSILON6)return void 0;var x=1/A;if(s=e.subtract(h,n,E),l=e.dot(s,w)*x,0>l||l>1)return void 0;if(c=e.cross(s,p,C),f=e.dot(d,c)*x,0>f||l+f>1)return void 0;m=e.dot(S,c)*x}return m}function f(e,t,r,n){var o=t*t-4*e*r;if(0>o)return void 0;if(o>0){var a=1/(2*e),i=Math.sqrt(o),u=(-t+i)*a,s=(-t-i)*a;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function m(t,r,o){n(o)||(o={});var a=t.origin,i=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(a,u,g),l=e.dot(i,i),m=2*e.dot(i,c),h=e.magnitudeSquared(c)-s,d=f(l,m,h,w);return n(d)?(o.start=d.root0,o.stop=d.root1,o):void 0}function h(e,t,r){var n=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,o,c){var l,f=o*o,m=c*c,d=(t[i.COLUMN1ROW1]-t[i.COLUMN2ROW2])*m,p=c*(o*h(t[i.COLUMN1ROW0],t[i.COLUMN0ROW1],a.EPSILON15)+r.y),y=t[i.COLUMN0ROW0]*f+t[i.COLUMN2ROW2]*m+o*r.x+n,v=m*h(t[i.COLUMN2ROW1],t[i.COLUMN1ROW2],a.EPSILON15),g=c*(o*h(t[i.COLUMN2ROW0],t[i.COLUMN0ROW2])+r.z),E=[];if(0===g&&0===v){if(l=u.computeRealRoots(d,p,y),0===l.length)return E;var C=l[0],S=Math.sqrt(Math.max(1-C*C,0));if(E.push(new e(o,c*C,c*-S)),E.push(new e(o,c*C,c*S)),2===l.length){var w=l[1],A=Math.sqrt(Math.max(1-w*w,0));E.push(new e(o,c*w,c*-A)),E.push(new e(o,c*w,c*A))}return E}var x=g*g,b=v*v,T=d*d,M=g*v,R=T+b,O=2*(p*d+M),I=2*y*d+p*p-b+x,N=2*(y*p-M),L=y*y-x;if(0===R&&0===O&&0===I&&0===N)return E;l=s.computeRealRoots(R,O,I,N,L);var z=l.length;if(0===z)return E;for(var P=0;z>P;++P){var D,F=l[P],_=F*F,B=Math.max(1-_,0),U=Math.sqrt(B);D=a.sign(d)===a.sign(y)?h(d*_+y,p*F,a.EPSILON12):a.sign(y)===a.sign(p*F)?h(d*_,p*F+y,a.EPSILON12):h(d*_+p*F,y,a.EPSILON12);var G=h(v*F,g,a.EPSILON15),q=D*G;0>q?E.push(new e(o,c*F,c*U)):q>0?E.push(new e(o,c*F,c*-U)):0!==U?(E.push(new e(o,c*F,c*-U)),E.push(new e(o,c*F,c*U)),++P):E.push(new e(o,c*F,c*U))}return E}var p={};p.rayPlane=function(t,r,o){n(o)||(o=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON15)return void 0;var l=(-r.distance-e.dot(s,i))/c;return 0>l?void 0:(o=e.multiplyByScalar(u,l,o),e.add(i,o,o))};var y=new e,v=new e,g=new e,E=new e,C=new e;p.rayTriangle=function(t,r,o,a,i,u){var s=l(t,r,o,a,i);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var S=new c;p.lineSegmentTriangle=function(t,r,o,a,i,u,s){var c=S;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,o,a,i,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var w={root0:0,root1:0};p.raySphere=function(e,t,r){return r=m(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var A=new c;p.lineSegmentSphere=function(t,r,o,a){var i=A;e.clone(t,i.origin);var u=e.subtract(r,t,i.direction),s=e.magnitude(u);return e.normalize(u,u),a=m(i,o,a),!n(a)||a.stop<0||a.start>s?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a)};var x=new e,b=new e;p.rayEllipsoid=function(t,r){var n,o,a,i,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,x),l=e.multiplyComponents(s,t.direction,b),f=e.magnitudeSquared(c),m=e.dot(c,l);if(f>1){if(m>=0)return void 0;var h=m*m;if(n=f-1,o=e.magnitudeSquared(l),a=o*n,a>h)return void 0;if(h>a){i=m*m-a,u=-m+Math.sqrt(i);var d=u/o,p=n/u;return p>d?{start:d,stop:p}:{start:p,stop:d}}var y=Math.sqrt(n/o);return{start:y,stop:y}}return 1>f?(n=f-1,o=e.magnitudeSquared(l),a=o*n,i=m*m-a,u=-m+Math.sqrt(i),{start:0,stop:u/o}):0>m?(o=e.magnitudeSquared(l),{start:0,stop:-m/o}):void 0};var T=new e,M=new e,R=new e,O=new e,I=new e,N=new i,L=new i,z=new i,P=new i,D=new i,F=new i,_=new i,B=new e,U=new e,G=new t;p.grazingAltitudeLocation=function(t,r){var o=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(o);if(e.dot(u,s)>=0)return o;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,T),m=e.mostOrthogonalAxis(l,O),h=e.normalize(e.cross(m,f,M),M),p=e.normalize(e.cross(f,h,R),R),y=N;y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=h.x,y[4]=h.y,y[5]=h.z,y[6]=p.x,y[7]=p.y,y[8]=p.z;var v=i.transpose(y,L),g=i.fromScale(r.radii,z),E=i.fromScale(r.oneOverRadii,P),C=D;C[0]=0,C[1]=-u.z,C[2]=u.y,C[3]=u.z,C[4]=0,C[5]=-u.x,C[6]=-u.y,C[7]=u.x,C[8]=0;var S,w,A=i.multiply(i.multiply(v,E,F),C,F),x=i.multiply(i.multiply(A,g,_),y,_),b=i.multiplyByVector(A,o,I),q=d(x,e.negate(b,T),0,0,1),k=q.length;if(k>0){for(var W=e.clone(e.ZERO,U),Y=Number.NEGATIVE_INFINITY,V=0;k>V;++V){S=i.multiplyByVector(g,i.multiplyByVector(y,q[V],B),B);var H=e.normalize(e.subtract(S,o,O),O),j=e.dot(H,u);j>Y&&(Y=j,W=e.clone(S,W))}var K=r.cartesianToCartographic(W,G);return Y=a.clamp(Y,0,1),w=e.magnitude(e.subtract(W,o,O))*Math.sqrt(1-Y*Y),w=c?-w:w,K.height=w,r.cartographicToCartesian(K)}return void 0};var q=new e;return p.lineSegmentPlane=function(t,r,o,i){n(i)||(i=new e);var u=e.subtract(r,t,q),s=o.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON6)return void 0;var l=e.dot(s,t),f=-(o.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,i),e.add(t,i,i),i)},p.trianglePlaneIntersection=function(t,r,n,o){var a=o.normal,i=o.distance,u=e.dot(a,t)+i<0,s=e.dot(a,r)+i<0,c=e.dot(a,n)+i<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,m;if((1===l||2===l)&&(f=new e,m=new e),1===l){if(u)return p.lineSegmentPlane(t,r,o,f),p.lineSegmentPlane(t,n,o,m),{positions:[t,r,n,f,m],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,o,f),p.lineSegmentPlane(r,t,o,m),{positions:[t,r,n,f,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,o,f),p.lineSegmentPlane(n,r,o,m),{positions:[t,r,n,f,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(r,t,o,f),p.lineSegmentPlane(n,t,o,m),{positions:[t,r,n,f,m],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,o,f),p.lineSegmentPlane(t,r,o,m),{positions:[t,r,n,f,m],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,o,f),p.lineSegmentPlane(r,n,o,m),{positions:[t,r,n,f,m],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,o,a){var i=-e.dot(o,n);return t(a)?(e.clone(o,a.normal),a.distance=i,a):new r(o,i)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),define("Core/PrimitiveType",["./freezeObject"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,o=r.maximumIndex,a=e(r.cacheSize,24),i=n.length;if(!t(o)){o=0;for(var u=0,s=n[u];i>u;)s>o&&(o=s),++u,s=n[u]}for(var c=[],l=0;o+1>l;l++)c[l]=0;for(var f=a+1,m=0;i>m;++m)f-c[n[m]]>a&&(c[n[m]]=f,++f);return(f-a+1)/(i/3)},r.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n>a;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function o(e,t,r,o,a,i,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var m=r[f];o[m].numLiveTriangles&&(s=0,a-o[m].timeStamp+2*o[m].numLiveTriangles<=t&&(s=a-o[m].timeStamp),(s>l||-1===l)&&(l=s,c=m)),++f}return-1===c?n(o,i,e,u):c}r=e(r,e.EMPTY_OBJECT);var a,i=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=i.length,l=0,f=0,m=i[f],h=c;if(t(u))l=u+1;else{for(;h>f;)m>l&&(l=m),++f,m=i[f];if(-1===l)return 0;++l}for(var d=[],p=0;l>p;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var y=0;h>f;)d[i[f]].vertexTriangles.push(y),++d[i[f]].numLiveTriangles,d[i[f+1]].vertexTriangles.push(y),++d[i[f+1]].numLiveTriangles,d[i[f+2]].vertexTriangles.push(y),++d[i[f+2]].numLiveTriangles,++y,f+=3;var v=0,g=s+1;a=1;var E,C,S=[],w=[],A=0,x=[],b=c/3,T=[];for(p=0;b>p;p++)T[p]=!1;for(var M,R;-1!==v;){S=[],C=d[v],R=C.vertexTriangles.length;for(var O=0;R>O;++O)if(y=C.vertexTriangles[O],!T[y]){T[y]=!0,f=y+y+y;for(var I=0;3>I;++I)M=i[f],S.push(M),w.push(M),x[A]=M,++A,E=d[M],--E.numLiveTriangles,g-E.timeStamp>s&&(E.timeStamp=g,++g),++f}v=o(i,s,S,d,g,w,l)}return x},r}),define("Core/GeometryPipeline",["./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,o,a,i,u,s,c,l,f,m,h,d,p,y,v,g,E,C,S,w){"use strict";function A(e,t,r,n,o){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=o,e[t++]=o,e[t]=r}function x(e){for(var t=e.length,r=6*(t/3),n=d.createTypedArray(t,r),o=0,a=0;t>a;a+=3,o+=6)A(n,o,e[a],e[a+1],e[a+2]);return n}function b(e){var t=e.length;if(t>=3){var r=6*(t-2),n=d.createTypedArray(t,r);A(n,0,e[0],e[1],e[2]);for(var o=6,a=3;t>a;++a,o+=6)A(n,o,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function T(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=d.createTypedArray(t,r),o=e[0],a=0,i=1;t>i;++i,a+=6)A(n,a,o,e[i],e[i+1]);return n}return new Uint16Array}function M(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&s(e[r])&&s(e[r].values)){var n=e[r];t[r]=new h({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function R(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&s(t[n])&&s(t[n].values))for(var o=t[n],a=0;a<o.componentsPerAttribute;++a)e[n].values.push(o.values[r*o.componentsPerAttribute+a])}function O(e,t){if(s(t))for(var r=t.values,o=r.length,a=0;o>a;a+=3)n.unpack(r,a,Z),E.multiplyByPoint(e,Z,Z),n.pack(Z,r,a)}function I(e,t){if(s(t))for(var r=t.values,o=r.length,a=0;o>a;a+=3)n.unpack(r,a,Z),g.multiplyByVector(e,Z,Z),Z=n.normalize(Z,Z),n.pack(Z,r,a)}function N(e){var t,r=e.length,n={},o=e[0].geometry.attributes;for(t in o)if(o.hasOwnProperty(t)&&s(o[t])&&s(o[t].values)){for(var a=o[t],u=a.values.length,c=!0,l=1;r>l;++l){var f=e[l].geometry.attributes[t];if(!s(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){c=!1;break}u+=f.values.length}c&&(n[t]=new h({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:i.createTypedArray(a.componentDatatype,u)}))}return n}function L(e){if(s(e.indices))return e;for(var t=m.computeNumberOfVertices(e),r=d.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function z(e){var t=m.computeNumberOfVertices(e),r=d.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,o=3;t>o;++o)r[n++]=o-1,r[n++]=0,r[n++]=o;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function P(e){var t=m.computeNumberOfVertices(e),r=d.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);for(var n=6,o=3;t-1>o;o+=2)r[n++]=o,r[n++]=o-1,r[n++]=o+1,t>o+2&&(r[n++]=o,r[n++]=o+1,r[n++]=o+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function D(e){if(s(e.indices))return e;for(var t=m.computeNumberOfVertices(e),r=d.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function F(e){var t=m.computeNumberOfVertices(e),r=d.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return e.indices=r,e.primitiveType=S.LINES,e}function _(e){var t=m.computeNumberOfVertices(e),r=d.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function B(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return z(e);case S.TRIANGLE_STRIP:return P(e);case S.TRIANGLES:return L(e);case S.LINE_STRIP:return F(e);case S.LINE_LOOP:return _(e);case S.LINES:return D(e)}return e}function U(e,t){Math.abs(e.y)<v.EPSILON11&&(e.y=t?-v.EPSILON11:v.EPSILON11)}function G(e,t,r,o){n.add(e,n.multiplyByScalar(n.subtract(t,e,it),e.y/(e.y-t.y),it),r),n.clone(r,o),U(r,!0),U(o,!1)}function q(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;var n=e.y<0,o=t.y<0,a=r.y<0;U(e,n),U(t,o),U(r,a);var i=0;i+=n?1:0,i+=o?1:0,i+=a?1:0;var u=ft.indices;1===i?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(G(e,t,ut,ct),G(e,r,st,lt),u[0]=0,u[3]=1,u[4]=2,u[6]=1):o?(G(t,r,ut,ct),G(t,e,st,lt),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(G(r,e,ut,ct),G(r,t,st,lt),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===i&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?o?a||(G(r,e,ut,ct),G(r,t,st,lt),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(G(t,r,ut,ct),G(t,e,st,lt),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(G(e,t,ut,ct),G(e,r,st,lt),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=ft.positions;return s[0]=e,s[1]=t,s[2]=r,ft.length=3,(1===i||2===i)&&(s[3]=ut,s[4]=st,s[5]=ct,s[6]=lt,ft.length=7),ft}function k(t,o,a,i,u,c,l,f){if(s(u)||s(c)||s(l)||s(f)){var m,h,d,p,y,v,g,E,C,S,w,A,x=i.positions,b=x[0],T=x[1],M=x[2],R=pt,O=yt,I=vt,N=mt,L=ht,z=dt;s(u)&&(m=n.fromArray(u,3*t),h=n.fromArray(u,3*o),d=n.fromArray(u,3*a)),s(c)&&(p=n.fromArray(c,3*t),y=n.fromArray(c,3*o),v=n.fromArray(c,3*a)),s(l)&&(g=n.fromArray(l,3*t),E=n.fromArray(l,3*o),C=n.fromArray(l,3*a)),s(f)&&(S=r.fromArray(f,2*t),w=r.fromArray(f,2*o),A=r.fromArray(f,2*a));for(var P=3;P<x.length;++P){var D=x[P],F=e(D,b,T,M);if(s(u)){R=n.multiplyByScalar(m,F.x,R),O=n.multiplyByScalar(h,F.y,O),I=n.multiplyByScalar(d,F.z,I);var _=n.add(R,O,gt);n.add(_,I,_),n.normalize(_,_),u.push(_.x,_.y,_.z)}if(s(c)){R=n.multiplyByScalar(p,F.x,R),O=n.multiplyByScalar(y,F.y,O),I=n.multiplyByScalar(v,F.z,I);var B=n.add(R,O,gt);n.add(B,I,B),n.normalize(B,B),c.push(B.x,B.y,B.z)}if(s(l)){R=n.multiplyByScalar(g,F.x,R),O=n.multiplyByScalar(E,F.y,O),I=n.multiplyByScalar(C,F.z,I);var U=n.add(R,O,gt);n.add(U,I,U),n.normalize(U,U),l.push(U.x,U.y,U.z)}if(s(f)){N=r.multiplyByScalar(S,F.x,N),L=r.multiplyByScalar(w,F.y,L),z=r.multiplyByScalar(A,F.z,z);var G=r.add(N,L,N);r.add(G,z,G),f.push(G.x,G.y)}}}}function W(e){for(var t=e.attributes,r=t.position.values,o=s(t.normal)?t.normal.values:void 0,a=s(t.binormal)?t.binormal.values:void 0,u=s(t.tangent)?t.tangent.values:void 0,c=s(t.st)?t.st.values:void 0,l=e.indices,f=Array.prototype.slice.call(r,0),h=s(o)?Array.prototype.slice.call(o,0):void 0,p=s(a)?Array.prototype.slice.call(a,0):void 0,y=s(u)?Array.prototype.slice.call(u,0):void 0,v=s(c)?Array.prototype.slice.call(c,0):void 0,g=[],E=l.length,C=0;E>C;C+=3){var S=l[C],w=l[C+1],A=l[C+2],x=n.fromArray(r,3*S),b=n.fromArray(r,3*w),T=n.fromArray(r,3*A),M=q(x,b,T);if(s(M))if(f[3*S+1]=M.positions[0].y,f[3*w+1]=M.positions[1].y,f[3*A+1]=M.positions[2].y,M.length>3){for(var R=f.length/3,O=0;O<M.indices.length;++O){var I=M.indices[O];3>I?g.push(l[C+I]):g.push(I-3+R)}for(var N=3;N<M.positions.length;++N){var L=M.positions[N];f.push(L.x,L.y,L.z)}k(S,w,A,M,h,p,y,v)}else g.push(S,w,A);else g.push(S,w,A)}e.attributes.position.values=new Float64Array(f),s(h)&&(t.normal.values=i.createTypedArray(t.normal.componentDatatype,h)),s(p)&&(t.binormal.values=i.createTypedArray(t.binormal.componentDatatype,p)),s(y)&&(t.tangent.values=i.createTypedArray(t.tangent.componentDatatype,y)),s(v)&&(t.st.values=i.createTypedArray(t.st.componentDatatype,v));var z=m.computeNumberOfVertices(e);e.indices=d.createTypedArray(z,g)}function Y(e){for(var t=e.attributes,r=t.position.values,o=e.indices,a=Array.prototype.slice.call(r,0),i=[],u=C.fromPointNormal(n.ZERO,n.UNIT_Y),c=o.length,l=0;c>l;l+=2){var f=o[l],h=o[l+1],p=n.fromArray(r,3*f),g=n.fromArray(r,3*h);if(Math.abs(p.y)<v.EPSILON6&&(p.y=p.y<0?-v.EPSILON6:v.EPSILON6,a[3*f+1]=p.y),Math.abs(g.y)<v.EPSILON6&&(g.y=g.y<0?-v.EPSILON6:v.EPSILON6,a[3*h+1]=g.y),i.push(f),p.x<0||g.x<0){var E=y.lineSegmentPlane(p,g,u);if(s(E)){var S=n.multiplyByScalar(n.UNIT_Y,5*v.EPSILON9,Et);p.y<0&&n.negate(S,S);var w=a.length/3;i.push(w,w+1);var A=n.add(E,S,Ct);a.push(A.x,A.y,A.z),n.negate(S,S),n.add(E,S,A),a.push(A.x,A.y,A.z)}}i.push(h)}e.attributes.position.values=new Float64Array(a);var x=m.computeNumberOfVertices(e);e.indices=d.createTypedArray(x,i)}var V={};V.toWireframe=function(e){var t=e.indices;if(s(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=x(t);break;case S.TRIANGLE_STRIP:e.indices=b(t);break;case S.TRIANGLE_FAN:e.indices=T(t);break;default:throw new c("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=S.LINES}return e},V.createLineSegmentsForVectors=function(e,r,n){r=u(r,"normal"),n=u(n,1e4);for(var o=e.attributes.position.values,a=e.attributes[r].values,c=o.length,l=new Float64Array(2*c),f=0,d=0;c>d;d+=3)l[f++]=o[d],l[f++]=o[d+1],l[f++]=o[d+2],l[f++]=o[d]+a[d]*n,l[f++]=o[d+1]+a[d+1]*n,l[f++]=o[d+2]+a[d+2]*n;var p,y=e.boundingSphere;return s(y)&&(p=new t(y.center,y.radius+n)),new m({attributes:{position:new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:p})},V.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent"],n=e.attributes,o={},a=0,i=r.length;for(t=0;i>t;++t){var u=r[t];s(n[u])&&(o[u]=a++)}for(var c in n)n.hasOwnProperty(c)&&!s(o[c])&&(o[c]=a++);return o},V.reorderForPreVertexCache=function(e){var t=m.computeNumberOfVertices(e),r=e.indices;if(s(r)){for(var n=new Int32Array(t),o=0;t>o;o++)n[o]=-1;for(var a,u=r,c=u.length,l=d.createTypedArray(t,c),f=0,h=0,p=0;c>f;)a=n[u[f]],-1!==a?l[h]=a:(a=u[f],n[a]=p,l[h]=p,++p),++f,++h;e.indices=l;var y=e.attributes;for(var v in y)if(y.hasOwnProperty(v)&&s(y[v])&&s(y[v].values)){for(var g=y[v],E=g.values,C=0,S=g.componentsPerAttribute,w=i.createTypedArray(g.componentDatatype,p*S);t>C;){var A=n[C];if(-1!==A)for(o=0;S>o;o++)w[S*A+o]=E[S*C+o];++C}g.values=w}}return e},V.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&s(r)){for(var n=r.length,o=0,a=0;n>a;a++)r[a]>o&&(o=r[a]);e.indices=w.tipsify({indices:r,maximumIndex:o,cacheSize:t})}return e},V.fitToUnsignedShortIndices=function(e){var t=[],r=m.computeNumberOfVertices(e);if(s(e.indices)&&r>v.SIXTY_FOUR_KILOBYTES){var n,o=[],a=[],i=0,u=M(e.attributes),c=e.indices,l=c.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var h=0;n>h;++h){var d=c[f+h],p=o[d];s(p)||(p=i++,o[d]=p,R(u,e.attributes,d)),a.push(p)}i+n>v.SIXTY_FOUR_KILOBYTES&&(t.push(new m({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),o=[],a=[],i=0,u=M(e.attributes))}0!==a.length&&t.push(new m({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var H=new n,j=new a;V.projectTo2D=function(e,t,r,o,a){var u=e.attributes[t];a=s(a)?a:new f;for(var l=a.ellipsoid,m=u.values,d=new Float64Array(m.length),p=0,y=0;y<m.length;y+=3){var v=n.fromArray(m,y,H),g=l.cartesianToCartographic(v,j);if(!s(g))throw new c("Could not project point ("+v.x+", "+v.y+", "+v.z+") to 2D.");var E=a.project(g,H);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z}return e.attributes[r]=u,e.attributes[o]=new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:d}),delete e.attributes[t],e};var K={high:0,low:0};V.encodeAttribute=function(e,t,r,n){for(var o=e.attributes[t],a=o.values,u=a.length,s=new Float32Array(u),c=new Float32Array(u),f=0;u>f;++f)l.encode(a[f],K),s[f]=K.high,c[f]=K.low;var m=o.componentsPerAttribute;
  return e.attributes[r]=new h({componentDatatype:i.FLOAT,componentsPerAttribute:m,values:s}),e.attributes[n]=new h({componentDatatype:i.FLOAT,componentsPerAttribute:m,values:c}),delete e.attributes[t],e};var Z=new n,X=new E,Q=new g;V.transformToWorldCoordinates=function(e){var r=e.modelMatrix;if(E.equals(r,E.IDENTITY))return e;var n=e.geometry.attributes;O(r,n.position),O(r,n.prevPosition),O(r,n.nextPosition),(s(n.normal)||s(n.binormal)||s(n.tangent))&&(E.inverse(r,X),E.transpose(X,X),E.getRotation(X,Q),I(Q,n.normal),I(Q,n.binormal),I(Q,n.tangent));var o=e.geometry.boundingSphere;return s(o)&&(e.geometry.boundingSphere=t.transform(o,r,o)),e.modelMatrix=E.clone(E.IDENTITY),e};var J=new n;V.combine=function(e){var r,o,a,i,u=e.length;e[0].modelMatrix;var c,l,f,h=s(e[0].geometry.indices),p=e[0].geometry.primitiveType,y=N(e);for(r in y)if(y.hasOwnProperty(r))for(c=y[r].values,i=0,o=0;u>o;++o)for(l=e[o].geometry.attributes[r].values,f=l.length,a=0;f>a;++a)c[i++]=l[a];var v;if(h){var g=0;for(o=0;u>o;++o)g+=e[o].geometry.indices.length;var E=m.computeNumberOfVertices(new m({attributes:y,primitiveType:S.POINTS})),C=d.createTypedArray(E,g),w=0,A=0;for(o=0;u>o;++o){var x=e[o].geometry.indices,b=x.length;for(i=0;b>i;++i)C[w++]=A+x[i];A+=m.computeNumberOfVertices(e[o].geometry)}v=C}var T,M=new n,R=0;for(o=0;u>o;++o){if(T=e[o].geometry.boundingSphere,!s(T)){M=void 0;break}n.add(T.center,M,M)}if(s(M))for(n.divideByScalar(M,u,M),o=0;u>o;++o){T=e[o].geometry.boundingSphere;var O=n.magnitude(n.subtract(T.center,M,J))+T.radius;O>R&&(R=O)}return new m({attributes:y,indices:v,primitiveType:p,boundingSphere:s(M)?new t(M,R):void 0})};var $=new n,et=new n,tt=new n,rt=new n;V.computeNormal=function(e){for(var t=e.indices,r=e.attributes,o=r.position.values,a=r.position.values.length/3,u=t.length,s=new Array(a),c=new Array(u/3),l=new Array(u),f=0;a>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var m=0;for(f=0;u>f;f+=3){var d=t[f],p=t[f+1],y=t[f+2],v=3*d,g=3*p,E=3*y;et.x=o[v],et.y=o[v+1],et.z=o[v+2],tt.x=o[g],tt.y=o[g+1],tt.z=o[g+2],rt.x=o[E],rt.y=o[E+1],rt.z=o[E+2],s[d].count++,s[p].count++,s[y].count++,n.subtract(tt,et,tt),n.subtract(rt,et,rt),c[m]=n.cross(tt,rt,new n),m++}var C=0;for(f=0;a>f;f++)s[f].indexOffset+=C,C+=s[f].count;m=0;var S;for(f=0;u>f;f+=3){S=s[t[f]];var w=S.indexOffset+S.currentCount;l[w]=m,S.currentCount++,S=s[t[f+1]],w=S.indexOffset+S.currentCount,l[w]=m,S.currentCount++,S=s[t[f+2]],w=S.indexOffset+S.currentCount,l[w]=m,S.currentCount++,m++}var A=new Float32Array(3*a);for(f=0;a>f;f++){var x=3*f;if(S=s[f],S.count>0){for(n.clone(n.ZERO,$),m=0;m<S.count;m++)n.add($,c[l[S.indexOffset+m]],$);n.normalize($,$),A[x]=$.x,A[x+1]=$.y,A[x+2]=$.z}else A[x]=0,A[x+1]=0,A[x+2]=1}return e.attributes.normal=new h({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:A}),e};var nt=new n,ot=new n,at=new n;V.computeBinormalAndTangent=function(e){e.attributes;for(var t=e.indices,r=e.attributes.position.values,o=e.attributes.normal.values,a=e.attributes.st.values,u=e.attributes.position.values.length/3,s=t.length,c=new Array(3*u),l=0;l<c.length;l++)c[l]=0;var f,m,d;for(l=0;s>l;l+=3){var p=t[l],y=t[l+1],v=t[l+2];f=3*p,m=3*y,d=3*v;var g=2*p,E=2*y,C=2*v,S=r[f],w=r[f+1],A=r[f+2],x=a[g],b=a[g+1],T=a[E+1]-b,M=a[C+1]-b,R=1/((a[E]-x)*M-(a[C]-x)*T),O=(M*(r[m]-S)-T*(r[d]-S))*R,I=(M*(r[m+1]-w)-T*(r[d+1]-w))*R,N=(M*(r[m+2]-A)-T*(r[d+2]-A))*R;c[f]+=O,c[f+1]+=I,c[f+2]+=N,c[m]+=O,c[m+1]+=I,c[m+2]+=N,c[d]+=O,c[d+1]+=I,c[d+2]+=N}var L=new Float32Array(3*u),z=new Float32Array(3*u);for(l=0;u>l;l++){f=3*l,m=f+1,d=f+2;var P=n.fromArray(o,f,nt),D=n.fromArray(c,f,at),F=n.dot(P,D);n.multiplyByScalar(P,F,ot),n.normalize(n.subtract(D,ot,D),D),z[f]=D.x,z[m]=D.y,z[d]=D.z,n.normalize(n.cross(P,D,D),D),L[f]=D.x,L[m]=D.y,L[d]=D.z}return e.attributes.tangent=new h({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:z}),e.attributes.binormal=new h({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:L}),e};var it=new n,ut=new n,st=new n,ct=new n,lt=new n,ft={positions:new Array(7),indices:new Array(9)},mt=new r,ht=new r,dt=new r,pt=new n,yt=new n,vt=new n,gt=new n,Et=new n,Ct=new n;return V.wrapLongitude=function(e){var r=e.boundingSphere;if(s(r)){var n=r.center.x-r.radius;if(n>0||t.intersect(r,o.UNIT_Y)!==p.INTERSECTING)return e}return B(e),e.primitiveType===S.TRIANGLES?W(e):e.primitiveType===S.LINES&&Y(e),e},V}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,o,a,i,u){"use strict";var s=function(e){this._ellipsoid=r(e,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var o=this._semimajorAxis,a=t.longitude*o,i=s.geodeticLatitudeToMercatorAngle(t.latitude)*o,u=t.height;return n(r)?(r.x=a,r.y=i,r.z=u,r):new e(a,i,u)},s.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,a=e.x*o,i=s.mercatorAngleToGeodeticLatitude(e.y*o),u=e.z;return n(r)?(r.longitude=a,r.latitude=i,r.height=u,r):new t(a,i,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,o,a,i,u,s,c,l,f,m,h,d){"use strict";function p(e,t,r){var n,o=!r,a=e.length;if(!o&&a>1){var i=e[0].modelMatrix;for(n=1;a>n;++n)if(!h.equals(i,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;a>n;++n)f.transformToWorldCoordinates(e[n]);else h.clone(e[0].modelMatrix,t)}function y(e,n){for(var o=e.length,a=0;o>a;++a){var i=e[a],u=i.geometry,s=u.attributes,c=s.position,f=4*(c.values.length/c.componentsPerAttribute);s.pickColor=new l({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(f)});for(var m=n[a],h=t.floatToByte(m.red),d=t.floatToByte(m.green),p=t.floatToByte(m.blue),y=t.floatToByte(m.alpha),v=s.pickColor.values,g=0;f>g;g+=4)v[g]=h,v[g+1]=d,v[g+2]=p,v[g+3]=y}}function v(e){var t,r=e.length,n=[],a=e[0].attributes;for(t in a)if(a.hasOwnProperty(t)){for(var i=a[t],u=!0,s=1;r>s;++s){var c=e[s].attributes[t];if(!o(c)||i.componentDatatype!==c.componentDatatype||i.componentsPerAttribute!==c.componentsPerAttribute||i.normalize!==c.normalize){u=!1;break}}u&&n.push(t)}return n}function g(e,t){for(var n=e.length,o=0;n>o;++o)for(var a=e[o],i=a.attributes,u=a.geometry,s=c.computeNumberOfVertices(u),f=t.length,m=0;f>m;++m){for(var h=t[m],d=i[h],p=d.componentDatatype,y=d.value,v=y.length,g=r.createTypedArray(p,s*v),E=0;s>E;++E)g.set(y,E*v);u.attributes[h]=new l({componentDatatype:p,componentsPerAttribute:v,normalize:d.normalize,values:g})}}function E(e){var t,n=e.instances,o=e.pickIds,a=e.projection,i=e.elementIndexUintSupported,u=e.scene3DOnly,s=e.allowPicking,c=e.vertexCacheOptimize,l=e.modelMatrix,m=n.length;if(n[0].geometry.primitiveType,p(n,l,u),!u)for(t=0;m>t;++t)f.wrapLongitude(n[t].geometry);s&&y(n,o);var h=v(n);if(g(n,h),c)for(t=0;m>t;++t)f.reorderForPostVertexCache(n[t].geometry),f.reorderForPreVertexCache(n[t].geometry);var d,E=f.combine(n),C=E.attributes;if(u)for(d in C)C.hasOwnProperty(d)&&C[d].componentDatatype===r.DOUBLE&&f.encodeAttribute(E,d,d+"3DHigh",d+"3DLow");else for(d in C)if(C.hasOwnProperty(d)&&C[d].componentDatatype===r.DOUBLE){var S=d+"3D",w=d+"2D";f.projectTo2D(E,d,S,w,a),f.encodeAttribute(E,S,S+"High",S+"Low"),f.encodeAttribute(E,w,w+"High",w+"Low")}return i?[E]:f.fitToUnsignedShortIndices(E)}function C(e,t,n){for(var o=[],a=e.attributes,i=n.length,u=0;i>u;++u){var s=n[u],c=a[s],l=c.componentDatatype;l===r.DOUBLE&&(l=r.FLOAT);var f=r.createTypedArray(l,c.values);o.push({index:t[s],componentDatatype:l,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:f}),delete a[s]}return o}function S(e,t,r){for(var a=[],i=v(e),u=e.length,s={},l={},f=0;u>f;++f)for(var m=e[f],h=c.computeNumberOfVertices(m.geometry),d=i.length,p=0;d>p;++p)for(var y=i[p],g=r[y],E=h;E>0;){for(var C,S=n(l[y],0),w=t[S],A=w.length,x=0;A>x&&(C=w[x],C.index!==g);++x);o(a[f])||(a[f]={}),o(a[f][y])||(a[f][y]={dirty:!1,value:m.attributes[y].value,indices:[]});var b,T=C.values.length/C.componentsPerAttribute,M=n(s[y],0);T>M+E?(b=E,a[f][y].indices.push({attribute:C,offset:M,count:b}),s[y]=M+E):(b=T-M,a[f][y].indices.push({attribute:C,offset:M,count:b}),s[y]=0,l[y]=S+1),E-=b}return a}function w(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var a=r[n];o(a)&&o(a.values)&&t.push(a.values.buffer)}o(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;r>n;++n)w(e[n],t)}function x(e,t){for(var r=e.length,n=0;r>n;++n)for(var o=e[n],a=o.length,i=0;a>i;++i)t.push(o[i].values.buffer)}function b(t){for(var r=1,n=t.length,a=0;n>a;a++){var i=t[a],u=i.attributes;r+=3+e.packedLength+(o(i.indices)?i.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&o(u[s])){var c=u[s];r+=5+c.values.length}}return r}function T(e,t){for(var r=e.length,n=new Uint32Array(e.length),o=0;r>o;++o)n[o]=e[o].toRgba();return t.push(n.buffer),n}function M(e){for(var r=e.length,n=new Array(r),o=0;r>o;o++)n[o]=t.fromRgba(e[o]);return n}function R(e){for(var t=e.length,r=1+17*t,n=0;t>n;n++){var a=e[n].attributes;for(var i in a)if(a.hasOwnProperty(i)&&o(a[i])){var u=a[i];r+=5+u.value.length}}return r}function O(e,t){var r=new Float64Array(R(e)),n={},a=[],i=e.length,u=0;r[u++]=i;for(var s=0;i>s;s++){var c=e[s];h.pack(c.modelMatrix,r,u),u+=h.packedLength;var l=c.attributes,f=[];for(var m in l)l.hasOwnProperty(m)&&o(l[m])&&(f.push(m),o(n[m])||(n[m]=a.length,a.push(m)));r[u++]=f.length;for(var d=0;d<f.length;d++){var p=f[d],y=l[p];r[u++]=n[p],r[u++]=y.componentDatatype,r[u++]=y.componentsPerAttribute,r[u++]=y.normalize,r[u++]=y.value.length,r.set(y.value,u),u+=y.value.length}}return t.push(r.buffer),{stringTable:a,packedData:r}}function I(e){for(var t=e.packedData,n=e.stringTable,o=new Array(t[0]),a=0,i=1;i<t.length;){var u=h.unpack(t,i);i+=h.packedLength;for(var s={},c=t[i++],l=0;c>l;l++){for(var f=n[t[i++]],m=t[i++],d=t[i++],p=0!==t[i++],y=t[i++],v=r.createTypedArray(m,y),g=0;y>g;g++)v[g]=t[i++];s[f]={componentDatatype:m,componentsPerAttribute:d,normalize:p,value:v}}o[a++]={attributes:s,modelMatrix:u}}return o}function N(e){for(var t=e.length,r=1+t,n=0;t>n;n++){var a=e[n];for(var i in a)if(a.hasOwnProperty(i)&&o(a[i])){var u=a[i];r+=3+3*u.indices.length+u.value.length}}return r}function L(e,t){var r=new Float64Array(N(e)),n=[],a=[],i={},u=e.length,s=0;r[s++]=u;for(var c=0;u>c;c++){var l=e[c],f=[];for(var m in l)l.hasOwnProperty(m)&&o(l[m])&&(f.push(m),o(i[m])||(i[m]=n.length,n.push(m)));r[s++]=f.length;for(var h=0;h<f.length;h++){var d=f[h],p=l[d];r[s++]=i[d];var y=p.indices,v=y.length;r[s++]=v;for(var g=0;v>g;g++){var E=y[g];r[s++]=E.count,r[s++]=E.offset;var C=a.indexOf(E.attribute);-1===C&&(C=a.length,a.push(E.attribute)),r[s++]=C}r[s++]=p.value.length,r.set(p.value,s),s+=p.value.length}}return t.push(r.buffer),{stringTable:n,packedData:r,attributeTable:a}}function z(e){for(var t=e.stringTable,n=e.attributeTable,o=e.packedData,a=new Array(o[0]),i=0,u=1,s=o.length;s>u;){for(var c={},l=o[u++],f=0;l>f;f++){for(var m=t[o[u++]],h=new Array(o[u++]),d=0;d<h.length;d++){var p={};p.count=o[u++],p.offset=o[u++],p.attribute=n[o[u++]],h[d]=p}for(var y=o[u++],v=r.createTypedArray(h[0].attribute.componentDatatype,y),g=0;y>g;g++)v[g]=o[u++];c[m]={dirty:!1,indices:h,value:v}}a[i++]=c}return a}if(!u.supportsTypedArrays())return{};var P={};return P.combineGeometry=function(e){for(var t={instances:e.instances,pickIds:e.pickIds,ellipsoid:e.ellipsoid,projection:e.projection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,modelMatrix:h.clone(e.modelMatrix)},r=E(t),n=f.createAttributeLocations(r[0]),o=t.instances,a=v(o),i=[],u=r.length,s=0;u>s;++s){var c=r[s];i.push(C(c,n,a))}var l=S(o,i,n);return{geometries:r,modelMatrix:t.modelMatrix,attributeLocations:n,vaAttributes:i,vaAttributeLocations:l}},P.packCreateGeometryResults=function(t,r){var n=new Float64Array(b(t)),a=[],i={},u=t.length,s=0;n[s++]=u;for(var c=0;u>c;c++){var l=t[c];n[s++]=l.primitiveType,e.pack(l.boundingSphere,n,s),s+=e.packedLength;var f=l.attributes,m=[];for(var h in f)f.hasOwnProperty(h)&&o(f[h])&&(m.push(h),o(i[h])||(i[h]=a.length,a.push(h)));n[s++]=m.length;for(var d=0;d<m.length;d++){var p=m[d],y=f[p];n[s++]=i[p],n[s++]=y.componentDatatype,n[s++]=y.componentsPerAttribute,n[s++]=y.normalize?1:0,n[s++]=y.values.length,n.set(y.values,s),s+=y.values.length}var v=o(l.indices)?l.indices.length:0;n[s++]=v,v>0&&(n.set(l.indices,s),s+=v)}return r.push(n.buffer),{stringTable:a,packedData:n}},P.unpackCreateGeometryResults=function(t){for(var n,o=t.stringTable,a=t.packedData,i=new Array(a[0]),u=0,s=1;s<a.length;){var f=a[s++],h=e.unpack(a,s);s+=e.packedLength;var d,p,y,v={},g=a[s++];for(n=0;g>n;n++){var E=o[a[s++]],C=a[s++];y=a[s++];var S=0!==a[s++];d=a[s++],p=r.createTypedArray(C,d);for(var w=0;d>w;w++)p[w]=a[s++];v[E]=new l({componentDatatype:C,componentsPerAttribute:y,normalize:S,values:p})}var A;if(d=a[s++],d>0){var x=p.length/y;for(A=m.createTypedArray(x,d),n=0;d>n;n++)A[n]=a[s++]}i[u++]=new c({primitiveType:f,boundingSphere:h,indices:A,attributes:v})}return i},P.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,o=0;n>o;o++)t.push(r[o].packedData.buffer);var a;return e.allowPicking&&(a=T(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:O(e.instances,t),packedPickIds:a,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,modelMatrix:e.modelMatrix}},P.unpackCombineGeometryParameters=function(e){for(var t=I(e.packedInstances),r=e.allowPicking?M(e.packedPickIds):void 0,n=e.createGeometryResults,o=n.length,a=0,u=0;o>u;u++)for(var c=P.unpackCreateGeometryResults(n[u]),l=c.length,f=0;l>f;f++)t[a++].geometry=c[f];var m=i.clone(e.ellipsoid),p=e.isGeographic?new s(m):new d(m);return h.clone(e.modelMatrix),{instances:t,pickIds:r,ellipsoid:m,projection:p,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,modelMatrix:e.modelMatrix}},P.packCombineGeometryResults=function(e,t){return A(e.geometries,t),x(e.vaAttributes,t),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:L(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix}},P.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:z(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix}},P}),define("Core/formatError",["./defined"],function(e){"use strict";var t=function(t){var r,n=t.name,o=t.message;r=e(n)&&e(o)?n+": "+o:t.toString();var a=t.stack;return e(a)&&(r+="\n"+a),r};return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";var n=function(n){var o,a=[],i={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;a.length=0,i.id=s.id,i.error=void 0,i.result=void 0;try{i.result=n(s.parameters,a)}catch(c){i.error=c instanceof Error?{name:c.name,message:c.message,stack:c.stack}:c}t(o)||(o=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{o(i,a)}catch(c){i.result=void 0,i.error="postMessage failed with error: "+r(c)+"\n  with responseMessage: "+JSON.stringify(i),o(i)}}};return n}),define("Workers/createGeometry",["../Core/defined","../Scene/PrimitivePipeline","./createTaskProcessorWorker","require"],function(e,t,r,n){"use strict";function o(t){var r=i[t];return e(r)||n(["./"+t],function(e){r=e,i[r]=e}),r}function a(r,n){for(var a=[],i=r.subTasks,u=0;u<i.length;u++){var s=i[u],c=s.geometry,l=s.moduleName;if(e(l)){var f=o(l);a.push(f(c))}else a.push(c)}return t.packCreateGeometryResults(a,n)}var i={};return r(a)})}();