text: /**
   * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
   *
   * Copyright 2011-2015 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 r=Object.freeze;return e(r)||(r=function(e){return e}),r}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var r=function(e,r){return void 0!==e?e:r};return r.EMPTY_OBJECT=e({}),r}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var r=function(e){this.name="DeveloperError",this.message=e;var r;try{throw new Error}catch(t){r=t.stack}this.stack=r};return r.prototype.toString=function(){var r=this.name+": "+this.message;return e(this.stack)&&(r+="\n"+this.stack.toString()),r},r.throwInstantiationError=function(){throw new r("This function defines an interface and should not be called directly.")},r}),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,r=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var t;for(this.mti==this.N+1&&this.init_genrand(5489),t=0;t<this.N-this.M;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+this.M]^e>>>1^r[1&e];for(;t<this.N-1;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+(this.M-this.N)]^e>>>1^r[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^r[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,r,t,i){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return 2*(n.clamp(e,0,255)/255)-1},n.sinh=function(e){var r=Math.pow(Math.E,e),t=Math.pow(Math.E,-1*e);return.5*(r-t)},n.cosh=function(e){var r=Math.pow(Math.E,e),t=Math.pow(Math.E,-1*e);return.5*(r+t)},n.lerp=function(e,r,t){return(1-t)*e+t*r},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){if(!t(e))throw new i("degrees is required.");return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){if(!t(e))throw new i("radians is required.");return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){if(!t(e))throw new i("angle is required.");var r=n.TWO_PI,o=e-Math.floor(e/r)*r;return o<-Math.PI?o+r:o>=Math.PI?o-r:o},n.negativePiToPi=function(e){if(!t(e))throw new i("x is required.");return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){if(!t(e))throw new i("x is required.");var r=n.mod(e,n.TWO_PI);return Math.abs(r)<n.EPSILON14&&Math.abs(e)>n.EPSILON14?n.TWO_PI:r},n.mod=function(e,r){if(!t(e))throw new i("m is required.");if(!t(r))throw new i("n is required.");return(e%r+r)%r},n.equalsEpsilon=function(e,n,o,a){if(!t(e))throw new i("left is required.");if(!t(n))throw new i("right is required.");if(!t(o))throw new i("relativeEpsilon is required.");a=r(a,o);var u=Math.abs(e-n);return a>=u||u<=o*Math.max(Math.abs(e),Math.abs(n))};var o=[1];n.factorial=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");var r=o.length;if(e>=r)for(var t=o[r-1],n=r;e>=n;n++)o.push(t*n);return o[e]},n.incrementWrap=function(e,n,o){if(o=r(o,0),!t(e))throw new i("n is required.");if(o>=n)throw new i("maximumValue must be greater than minimumValue.");return++e,e>n&&(e=o),e},n.isPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,r,n){if(!t(e))throw new i("value is required");if(!t(r))throw new i("min is required.");if(!t(n))throw new i("max is required.");return r>e?r:e>n?n:e};var a=new e;return n.setRandomNumberSeed=function(r){if(!t(r))throw new i("seed is required.");a=new e(r)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){if(!t(e))throw new i("value is required.");return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){if(!t(e))throw new i("value is required.");return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,r){if(!t(e))throw new i("angle is required.");if(!t(r))throw new i("radius is required.");return 2*r*Math.sin(.5*e)},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,r,t,i,n){"use strict";var o=function(r,t,i){this.x=e(r,0),this.y=e(t,0),this.z=e(i,0)};o.fromSpherical=function(i,n){if(!r(i))throw new t("spherical is required");r(n)||(n=new o);var a=i.clock,u=i.cone,s=e(i.magnitude,1),f=s*Math.sin(u);return n.x=f*Math.cos(a),n.y=f*Math.sin(a),n.z=s*Math.cos(u),n},o.fromElements=function(e,t,i,n){return r(n)?(n.x=e,n.y=t,n.z=i,n):new o(e,t,i)},o.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z):void 0},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(i,n,o){if(!r(i))throw new t("value is required");if(!r(n))throw new t("array is required");o=e(o,0),n[o++]=i.x,n[o++]=i.y,n[o]=i.z},o.unpack=function(i,n,a){if(!r(i))throw new t("array is required");return n=e(n,0),r(a)||(a=new o),a.x=i[n++],a.y=i[n++],a.z=i[n],a},o.fromArray=o.unpack,o.maximumComponent=function(e){if(!r(e))throw new t("cartesian is required");return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){if(!r(e))throw new t("cartesian is required");return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,i,n){if(!r(e))throw new t("first is required.");if(!r(i))throw new t("second is required.");if(!r(n))throw new t("result is required.");return n.x=Math.min(e.x,i.x),n.y=Math.min(e.y,i.y),n.z=Math.min(e.z,i.z),n},o.maximumByComponent=function(e,i,n){if(!r(e))throw new t("first is required.");if(!r(i))throw new t("second is required.");if(!r(n))throw new t("result is required.");return n.x=Math.max(e.x,i.x),n.y=Math.max(e.y,i.y),n.z=Math.max(e.z,i.z),n},o.magnitudeSquared=function(e){if(!r(e))throw new t("cartesian is required");return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,i){if(!r(e)||!r(i))throw new t("left and right are required.");return o.subtract(e,i,a),o.magnitude(a)},o.distanceSquared=function(e,i){if(!r(e)||!r(i))throw new t("left and right are required.");return o.subtract(e,i,a),o.magnitudeSquared(a)},o.normalize=function(e,i){if(!r(e))throw new t("cartesian is required");if(!r(i))throw new t("result is required");var n=o.magnitude(e);return i.x=e.x/n,i.y=e.y/n,i.z=e.z/n,i},o.dot=function(e,i){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");return e.x*i.x+e.y*i.y+e.z*i.z},o.multiplyComponents=function(e,i,n){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");if(!r(n))throw new t("result is required");return n.x=e.x*i.x,n.y=e.y*i.y,n.z=e.z*i.z,n},o.add=function(e,i,n){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");if(!r(n))throw new t("result is required");return n.x=e.x+i.x,n.y=e.y+i.y,n.z=e.z+i.z,n},o.subtract=function(e,i,n){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");if(!r(n))throw new t("result is required");return n.x=e.x-i.x,n.y=e.y-i.y,n.z=e.z-i.z,n},o.multiplyByScalar=function(e,i,n){if(!r(e))throw new t("cartesian is required");if("number"!=typeof i)throw new t("scalar is required and must be a number.");if(!r(n))throw new t("result is required");return n.x=e.x*i,n.y=e.y*i,n.z=e.z*i,n},o.divideByScalar=function(e,i,n){if(!r(e))throw new t("cartesian is required");if("number"!=typeof i)throw new t("scalar is required and must be a number.");if(!r(n))throw new t("result is required");return n.x=e.x/i,n.y=e.y/i,n.z=e.z/i,n},o.negate=function(e,i){if(!r(e))throw new t("cartesian is required");if(!r(i))throw new t("result is required");return i.x=-e.x,i.y=-e.y,i.z=-e.z,i},o.abs=function(e,i){if(!r(e))throw new t("cartesian is required");if(!r(i))throw new t("result is required");return i.x=Math.abs(e.x),i.y=Math.abs(e.y),i.z=Math.abs(e.z),i};var u=new o;o.lerp=function(e,i,n,a){if(!r(e))throw new t("start is required.");if(!r(i))throw new t("end is required.");if("number"!=typeof n)throw new t("t is required and must be a number.");if(!r(a))throw new t("result is required.");return o.multiplyByScalar(i,n,u),a=o.multiplyByScalar(e,1-n,a),o.add(u,a,a)};var s=new o,f=new o;o.angleBetween=function(e,i){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");o.normalize(e,s),o.normalize(i,f);var n=o.dot(s,f),a=o.magnitude(o.cross(s,f,s));return Math.atan2(a,n)};var c=new o;o.mostOrthogonalAxis=function(e,i){if(!r(e))throw new t("cartesian is required.");if(!r(i))throw new t("result is required.");var n=o.normalize(e,c);return o.abs(n,n),i=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,i):o.clone(o.UNIT_Z,i):n.y<=n.z?o.clone(o.UNIT_Y,i):o.clone(o.UNIT_Z,i)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,r,t){return e.x===r[t]&&e.y===r[t+1]&&e.z===r[t+2]},o.equalsEpsilon=function(e,t,i,o){return e===t||r(e)&&r(t)&&n.equalsEpsilon(e.x,t.x,i,o)&&n.equalsEpsilon(e.y,t.y,i,o)&&n.equalsEpsilon(e.z,t.z,i,o)},o.cross=function(e,i,n){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");if(!r(n))throw new t("result is required");var o=e.x,a=e.y,u=e.z,s=i.x,f=i.y,c=i.z,h=a*c-u*f,w=u*s-o*c,d=o*f-a*s;return n.x=h,n.y=w,n.z=d,n},o.fromDegrees=function(e,i,a,u,s){if(!r(e))throw new t("longitude is required");if(!r(i))throw new t("latitude is required");var f=n.toRadians(e),c=n.toRadians(i);return o.fromRadians(f,c,a,u,s)};var h=new o,w=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(i,n,a,u,s){if(!r(i))throw new t("longitude is required");if(!r(n))throw new t("latitude is required");a=e(a,0);var f=r(u)?u.radiiSquared:d,c=Math.cos(n);h.x=c*Math.cos(i),h.y=c*Math.sin(i),h.z=Math.sin(n),h=o.normalize(h,h),o.multiplyComponents(f,h,w);var l=Math.sqrt(o.dot(h,w));return w=o.divideByScalar(w,l,w),h=o.multiplyByScalar(h,a,h),r(s)||(s=new o),o.add(w,h,s)},o.fromDegreesArray=function(e,i,a){if(!r(e))throw new t("positions is required.");for(var u=new Array(e.length),s=0;s<e.length;s++)u[s]=n.toRadians(e[s]);return o.fromRadiansArray(u,i,a)},o.fromRadiansArray=function(e,i,n){if(!r(e))throw new t("positions is required.");if(e.length<2)throw new t("positions length cannot be less than 2.");if(0!==e.length%2)throw new t("positions length must be a multiple of 2.");var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var u=0;a>u;u+=2){var s=e[u],f=e[u+1];n[u/2]=o.fromRadians(s,f,0,i,n[u/2])}return n},o.fromDegreesArrayHeights=function(e,i,a){if(!r(e))throw new t("positions is required.");if(e.length<3)throw new t("positions length cannot be less than 3.");if(0!==e.length%3)throw new t("positions length must be a multiple of 3.");for(var u=new Array(e.length),s=0;s<e.length;s+=3)u[s]=n.toRadians(e[s]),u[s+1]=n.toRadians(e[s+1]),u[s+2]=e[s+2];return o.fromRadiansArrayHeights(u,i,a)},o.fromRadiansArrayHeights=function(e,i,n){if(!r(e))throw new t("positions is required.");if(e.length<3)throw new t("positions length cannot be less than 3.");if(0!==e.length%3)throw new t("positions length must be a multiple of 3.");var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var u=0;a>u;u+=3){var s=e[u],f=e[u+1],c=e[u+2];n[u/3]=o.fromRadians(s,f,c,i,n[u/3])}return n},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(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,r,t){return o.equalsEpsilon(this,e,r,t)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,r,t,i,n){"use strict";var o=function(r,t,i){this.longitude=e(r,0),this.latitude=e(t,0),this.height=e(i,0)};return o.fromRadians=function(i,n,a,u){if(!r(i))throw new t("longitude is required.");if(!r(n))throw new t("latitude is required.");return a=e(a,0),r(u)?(u.longitude=i,u.latitude=n,u.height=a,u):new o(i,n,a)},o.fromDegrees=function(e,i,a,u){if(!r(e))throw new t("longitude is required.");if(!r(i))throw new t("latitude is required.");return e=n.toRadians(e),i=n.toRadians(i),o.fromRadians(e,i,a,u)},o.clone=function(e,t){return r(e)?r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new o(e.longitude,e.latitude,e.height):void 0},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},o.equalsEpsilon=function(e,i,n){if("number"!=typeof n)throw new t("epsilon is required and must be a number.");return e===i||r(e)&&r(i)&&Math.abs(e.longitude-i.longitude)<=n&&Math.abs(e.latitude-i.latitude)<=n&&Math.abs(e.height-i.height)<=n},o.ZERO=i(new o(0,0,0)),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,r){return o.equalsEpsilon(this,e,r)},o.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},o}),define("Core/deprecationWarning",["./defined","./DeveloperError"],function(e,r){"use strict";var t={},i=function(i,n){if(!e(i)||!e(n))throw new r("identifier and message are required.");e(t[i])||(t[i]=!0,console.log(n))};return i}),define("Core/defineProperties",["./defined"],function(e){"use strict";var r=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),t=Object.defineProperties;return r&&e(t)||(t=function(e){return e}),t}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,r,t,i,n,o,a,u){"use strict";function s(r,i,n,a){if(i=t(i,0),n=t(n,0),a=t(a,0),0>i||0>n||0>a)throw new o("All radii components must be greater than or equal to zero.");r._radii=new e(i,n,a),r._radiiSquared=new e(i*i,n*n,a*a),r._radiiToTheFourth=new e(i*i*i*i,n*n*n*n,a*a*a*a),r._oneOverRadii=new e(0===i?0:1/i,0===n?0:1/n,0===a?0:1/a),r._oneOverRadiiSquared=new e(0===i?0:1/(i*i),0===n?0:1/(n*n),0===a?0:1/(a*a)),r._minimumRadius=Math.min(i,n,a),r._maximumRadius=Math.max(i,n,a),r._centerToleranceSquared=u.EPSILON1}var f=function(e,r,t){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,r,t)};n(f.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}}}),f.clone=function(r,t){if(!i(r))return void 0;var n=r._radii;return i(t)?(e.clone(n,t._radii),e.clone(r._radiiSquared,t._radiiSquared),e.clone(r._radiiToTheFourth,t._radiiToTheFourth),e.clone(r._oneOverRadii,t._oneOverRadii),e.clone(r._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=r._minimumRadius,t._maximumRadius=r._maximumRadius,t._centerToleranceSquared=r._centerToleranceSquared,t):new f(n.x,n.y,n.z)},f.fromCartesian3=function(e,r){return i(r)||(r=new f),i(e)?(s(r,e.x,e.y,e.z),r):r},f.WGS84=a(new f(6378137,6378137,6356752.314245179)),f.UNIT_SPHERE=a(new f(1,1,1)),f.MOON=a(new f(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),f.prototype.clone=function(e){return f.clone(this,e)},f.packedLength=e.packedLength,f.pack=function(r,n,a){if(!i(r))throw new o("value is required");if(!i(n))throw new o("array is required");a=t(a,0),e.pack(r._radii,n,a)},f.unpack=function(r,n,a){if(!i(r))throw new o("array is required");n=t(n,0);var u=e.unpack(r,n);return f.fromCartesian3(u,a)},f.prototype.geocentricSurfaceNormal=e.normalize,f.prototype.geodeticSurfaceNormalCartographic=function(r,t){if(!i(r))throw new o("cartographic is required.");var n=r.longitude,a=r.latitude,u=Math.cos(a),s=u*Math.cos(n),f=u*Math.sin(n),c=Math.sin(a);return i(t)||(t=new e),t.x=s,t.y=f,t.z=c,e.normalize(t,t)},f.prototype.geodeticSurfaceNormal=function(r,t){return i(t)||(t=new e),t=e.multiplyComponents(r,this._oneOverRadiiSquared,t),e.normalize(t,t)};var c=new e,h=new e;f.prototype.cartographicToCartesian=function(r,t){var n=c,o=h;this.geodeticSurfaceNormalCartographic(r,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,r.height,n),i(t)||(t=new e),e.add(o,n,t)},f.prototype.cartographicArrayToCartesianArray=function(e,r){if(!i(e))throw new o("cartographics is required.");var t=e.length;i(r)?r.length=t:r=new Array(t);for(var n=0;t>n;n++)r[n]=this.cartographicToCartesian(e[n],r[n]);return r};var w=new e,d=new e,l=new e;f.prototype.cartesianToCartographic=function(t,n){var o=this.scaleToGeodeticSurface(t,d);if(!i(o))return void 0;var a=this.geodeticSurfaceNormal(o,w),s=e.subtract(t,o,l),f=Math.atan2(a.y,a.x),c=Math.asin(a.z),h=u.sign(e.dot(s,t))*e.magnitude(s);return i(n)?(n.longitude=f,n.latitude=c,n.height=h,n):new r(f,c,h)},f.prototype.cartesianArrayToCartographicArray=function(e,r){if(!i(e))throw new o("cartesians is required.");var t=e.length;i(r)?r.length=t:r=new Array(t);for(var n=0;t>n;++n)r[n]=this.cartesianToCartographic(e[n],r[n]);return r};var m=new e,p=new e;return f.prototype.scaleToGeodeticSurface=function(r,t){if(!i(r))throw new o("cartesian is required.");var n=r.x,a=r.y,s=r.z,f=this._oneOverRadii,c=f.x,h=f.y,w=f.z,d=n*n*c*c,l=a*a*h*h,y=s*s*w*w,q=d+l+y,v=Math.sqrt(1/q),g=e.multiplyByScalar(r,v,m);if(q<this._centerToleranceSquared)return isFinite(v)?e.clone(g,t):void 0;var E=this._oneOverRadiiSquared,x=E.x,b=E.y,S=E.z,M=p;M.x=2*g.x*x,M.y=2*g.y*b,M.z=2*g.z*S;var O,_,z,I,T,N,P,R,A,C,L,U=(1-v)*e.magnitude(r)/(.5*e.magnitude(M)),D=0;do{U-=D,z=1/(1+U*x),I=1/(1+U*b),T=1/(1+U*S),N=z*z,P=I*I,R=T*T,A=N*z,C=P*I,L=R*T,O=d*N+l*P+y*R-1,_=d*A*x+l*C*b+y*L*S;var B=-2*_;D=O/B}while(Math.abs(O)>u.EPSILON12);return i(t)?(t.x=n*z,t.y=a*I,t.z=s*T,t):new e(n*z,a*I,s*T)},f.prototype.scaleToGeocentricSurface=function(r,t){if(!i(r))throw new o("cartesian is required.");i(t)||(t=new e);var n=r.x,a=r.y,u=r.z,s=this._oneOverRadiiSquared,f=1/Math.sqrt(n*n*s.x+a*a*s.y+u*u*s.z);return e.multiplyByScalar(r,f,t)},f.prototype.transformPositionToScaledSpace=function(r,t){return i(t)||(t=new e),e.multiplyComponents(r,this._oneOverRadii,t)},f.prototype.transformPositionFromScaledSpace=function(r,t){return i(t)||(t=new e),e.multiplyComponents(r,this._radii,t)},f.prototype.equals=function(r){return this===r||i(r)&&e.equals(this._radii,r._radii)},f.prototype.toString=function(){return this._radii.toString()},f}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,r,t,i,n,o,a){"use strict";var u=function(e){this._ellipsoid=t(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return n(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(r,t){var n=this._semimajorAxis,o=r.longitude*n,a=r.latitude*n,u=r.height;return i(t)?(t.x=o,t.y=a,t.z=u,t):new e(o,a,u)},u.prototype.unproject=function(e,t){if(!i(e))throw new o("cartesian is required");var n=this._oneOverSemimajorAxis,a=e.x*n,u=e.y*n,s=e.z;return i(t)?(t.longitude=a,t.latitude=u,t.height=s,t):new r(a,u,s)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var r={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(r)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";var r=function(r,t){this.start=e(r,0),this.stop=e(t,0)};return r}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,r,t,i,n){"use strict";var o=function(r,t,i,n){this.x=e(r,0),this.y=e(t,0),this.z=e(i,0),this.w=e(n,0)};o.fromElements=function(e,t,i,n,a){return r(a)?(a.x=e,a.y=t,a.z=i,a.w=n,a):new o(e,t,i,n)},o.fromColor=function(e,i){if(!r(e))throw new t("color is required");return r(i)?(i.x=e.red,i.y=e.green,i.z=e.blue,i.w=e.alpha,i):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w):void 0},o.packedLength=4,o.pack=function(i,n,o){if(!r(i))throw new t("value is required");if(!r(n))throw new t("array is required");o=e(o,0),n[o++]=i.x,n[o++]=i.y,n[o++]=i.z,n[o]=i.w},o.unpack=function(i,n,a){if(!r(i))throw new t("array is required");return n=e(n,0),r(a)||(a=new o),a.x=i[n++],a.y=i[n++],a.z=i[n++],a.w=i[n],a},o.fromArray=o.unpack,o.maximumComponent=function(e){if(!r(e))throw new t("cartesian is required");return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){if(!r(e))throw new t("cartesian is required");return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,i,n){if(!r(e))throw new t("first is required.");if(!r(i))throw new t("second is required.");if(!r(n))throw new t("result is required.");return n.x=Math.min(e.x,i.x),n.y=Math.min(e.y,i.y),n.z=Math.min(e.z,i.z),n.w=Math.min(e.w,i.w),n},o.maximumByComponent=function(e,i,n){if(!r(e))throw new t("first is required.");if(!r(i))throw new t("second is required.");if(!r(n))throw new t("result is required.");return n.x=Math.max(e.x,i.x),n.y=Math.max(e.y,i.y),n.z=Math.max(e.z,i.z),n.w=Math.max(e.w,i.w),n},o.magnitudeSquared=function(e){if(!r(e))throw new t("cartesian is required");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,i){if(!r(e)||!r(i))throw new t("left and right are required.");return o.subtract(e,i,a),o.magnitude(a)},o.distanceSquared=function(e,i){if(!r(e)||!r(i))throw new t("left and right are required.");return o.subtract(e,i,a),o.magnitudeSquared(a)},o.normalize=function(e,i){if(!r(e))throw new t("cartesian is required");if(!r(i))throw new t("result is required");var n=o.magnitude(e);return i.x=e.x/n,i.y=e.y/n,i.z=e.z/n,i.w=e.w/n,i},o.dot=function(e,i){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");return e.x*i.x+e.y*i.y+e.z*i.z+e.w*i.w},o.multiplyComponents=function(e,i,n){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");if(!r(n))throw new t("result is required");return n.x=e.x*i.x,n.y=e.y*i.y,n.z=e.z*i.z,n.w=e.w*i.w,n},o.add=function(e,i,n){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");if(!r(n))throw new t("result is required");return n.x=e.x+i.x,n.y=e.y+i.y,n.z=e.z+i.z,n.w=e.w+i.w,n},o.subtract=function(e,i,n){if(!r(e))throw new t("left is required");if(!r(i))throw new t("right is required");if(!r(n))throw new t("result is required");return n.x=e.x-i.x,n.y=e.y-i.y,n.z=e.z-i.z,n.w=e.w-i.w,n},o.multiplyByScalar=function(e,i,n){if(!r(e))throw new t("cartesian is required");if("number"!=typeof i)throw new t("scalar is required and must be a number.");if(!r(n))throw new t("result is required");return n.x=e.x*i,n.y=e.y*i,n.z=e.z*i,n.w=e.w*i,n},o.divideByScalar=function(e,i,n){if(!r(e))throw new t("cartesian is required");if("number"!=typeof i)throw new t("scalar is required and must be a number.");if(!r(n))throw new t("result is required");return n.x=e.x/i,n.y=e.y/i,n.z=e.z/i,n.w=e.w/i,n},o.negate=function(e,i){if(!r(e))throw new t("cartesian is required");if(!r(i))throw new t("result is required");return i.x=-e.x,i.y=-e.y,i.z=-e.z,i.w=-e.w,i},o.abs=function(e,i){if(!r(e))throw new t("cartesian is required");if(!r(i))throw new t("result is required");return i.x=Math.abs(e.x),i.y=Math.abs(e.y),i.z=Math.abs(e.z),i.w=Math.abs(e.w),i};var u=new o;o.lerp=function(e,i,n,a){if(!r(e))throw new t("start is required.");if(!r(i))throw new t("end is required.");if("number"!=typeof n)throw new t("t is required and must be a number.");if(!r(a))throw new t("result is required.");return o.multiplyByScalar(i,n,u),a=o.multiplyByScalar(e,1-n,a),o.add(u,a,a)};var s=new o;return o.mostOrthogonalAxis=function(e,i){if(!r(e))throw new t("cartesian is required.");if(!r(i))throw new t("result is required.");var n=o.normalize(e,s);return o.abs(n,n),i=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,i):o.clone(o.UNIT_W,i):n.z<=n.w?o.clone(o.UNIT_Z,i):o.clone(o.UNIT_W,i):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,i):o.clone(o.UNIT_W,i):n.z<=n.w?o.clone(o.UNIT_Z,i):o.clone(o.UNIT_W,i)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,r,t){return e.x===r[t]&&e.y===r[t+1]&&e.z===r[t+2]&&e.w===r[t+3]},o.equalsEpsilon=function(e,t,i,o){return e===t||r(e)&&r(t)&&n.equalsEpsilon(e.x,t.x,i,o)&&n.equalsEpsilon(e.y,t.y,i,o)&&n.equalsEpsilon(e.z,t.z,i,o)&&n.equalsEpsilon(e.w,t.w,i,o)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(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,r,t){return o.equalsEpsilon(this,e,r,t)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,r,t,i,n,o){"use strict";function a(e){for(var r=0,t=0;9>t;++t){var i=e[t];r+=i*i}return Math.sqrt(r)}function u(e){for(var r=0,t=0;3>t;++t){var i=e[f.getElementIndex(d[t],w[t])];r+=2*i*i}return Math.sqrt(r)}function s(e,r){for(var t=o.EPSILON15,i=0,n=1,a=0;3>a;++a){var u=Math.abs(e[f.getElementIndex(d[a],w[a])]);u>i&&(n=a,i=u)}var s=1,c=0,h=w[n],l=d[n];if(Math.abs(e[f.getElementIndex(l,h)])>t){var m,p=e[f.getElementIndex(l,l)],y=e[f.getElementIndex(h,h)],q=e[f.getElementIndex(l,h)],v=(p-y)/2/q;m=0>v?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),s=1/Math.sqrt(1+m*m),c=m*s}return r=f.clone(f.IDENTITY,r),r[f.getElementIndex(h,h)]=r[f.getElementIndex(l,l)]=s,r[f.getElementIndex(l,h)]=c,r[f.getElementIndex(h,l)]=-c,r}var f=function(e,t,i,n,o,a,u,s,f){this[0]=r(e,0),this[1]=r(n,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(o,0),this[5]=r(s,0),this[6]=r(i,0),this[7]=r(a,0),this[8]=r(f,0)};f.packedLength=9,f.pack=function(e,n,o){if(!t(e))throw new i("value is required");if(!t(n))throw new i("array is required");o=r(o,0),n[o++]=e[0],n[o++]=e[1],n[o++]=e[2],n[o++]=e[3],n[o++]=e[4],n[o++]=e[5],n[o++]=e[6],n[o++]=e[7],n[o++]=e[8]},f.unpack=function(e,n,o){if(!t(e))throw new i("array is required");return n=r(n,0),t(o)||(o=new f),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},f.clone=function(e,r){return t(e)?t(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r):new f(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},f.fromArray=function(e,n,o){if(!t(e))throw new i("array is required");return n=r(n,0),t(o)||(o=new f),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},f.fromColumnMajorArray=function(e,r){if(!t(e))throw new i("values parameter is required");return f.clone(e,r)},f.fromRowMajorArray=function(e,r){if(!t(e))throw new i("values is required.");return t(r)?(r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8],r):new f(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},f.fromQuaternion=function(e,r){if(!t(e))throw new i("quaternion is required");var n=e.x*e.x,o=e.x*e.y,a=e.x*e.z,u=e.x*e.w,s=e.y*e.y,c=e.y*e.z,h=e.y*e.w,w=e.z*e.z,d=e.z*e.w,l=e.w*e.w,m=n-s-w+l,p=2*(o-d),y=2*(a+h),q=2*(o+d),v=-n+s-w+l,g=2*(c-u),E=2*(a-h),x=2*(c+u),b=-n-s+w+l;return t(r)?(r[0]=m,r[1]=q,r[2]=E,r[3]=p,r[4]=v,r[5]=x,r[6]=y,r[7]=g,r[8]=b,r):new f(m,p,y,q,v,g,E,x,b)},f.fromScale=function(e,r){if(!t(e))throw new i("scale is required.");return t(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=e.y,r[5]=0,r[6]=0,r[7]=0,r[8]=e.z,r):new f(e.x,0,0,0,e.y,0,0,0,e.z)},f.fromUniformScale=function(e,r){if("number"!=typeof e)throw new i("scale is required.");return t(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=e,r[5]=0,r[6]=0,r[7]=0,r[8]=e,r):new f(e,0,0,0,e,0,0,0,e)},f.fromCrossProduct=function(e,r){if(!t(e))throw new i("vector is required.");return t(r)?(r[0]=0,r[1]=e.z,r[2]=-e.y,r[3]=-e.z,r[4]=0,r[5]=e.x,r[6]=e.y,r[7]=-e.x,r[8]=0,r):new f(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},f.fromRotationX=function(e,r){if(!t(e))throw new i("angle is required.");var n=Math.cos(e),o=Math.sin(e);return t(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=n,r[5]=o,r[6]=0,r[7]=-o,r[8]=n,r):new f(1,0,0,0,n,-o,0,o,n)},f.fromRotationY=function(e,r){if(!t(e))throw new i("angle is required.");var n=Math.cos(e),o=Math.sin(e);return t(r)?(r[0]=n,r[1]=0,r[2]=-o,r[3]=0,r[4]=1,r[5]=0,r[6]=o,r[7]=0,r[8]=n,r):new f(n,0,o,0,1,0,-o,0,n)},f.fromRotationZ=function(e,r){if(!t(e))throw new i("angle is required.");var n=Math.cos(e),o=Math.sin(e);return t(r)?(r[0]=n,r[1]=o,r[2]=0,r[3]=-o,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new f(n,-o,0,o,n,0,0,0,1)},f.toArray=function(e,r){if(!t(e))throw new i("matrix is required");return t(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},f.getElementIndex=function(e,r){if("number"!=typeof r||0>r||r>2)throw new i("row must be 0, 1, or 2.");if("number"!=typeof e||0>e||e>2)throw new i("column must be 0, 1, or 2.");return 3*e+r},f.getColumn=function(e,r,n){if(!t(e))throw new i("matrix is required.");if("number"!=typeof r||0>r||r>2)throw new i("index must be 0, 1, or 2.");if(!t(n))throw new i("result is required");var o=3*r,a=e[o],u=e[o+1],s=e[o+2];return n.x=a,n.y=u,n.z=s,n},f.setColumn=function(e,r,n,o){if(!t(e))throw new i("matrix is required");if(!t(n))throw new i("cartesian is required");if("number"!=typeof r||0>r||r>2)throw new i("index must be 0, 1, or 2.");if(!t(o))throw new i("result is required");o=f.clone(e,o);var a=3*r;return o[a]=n.x,o[a+1]=n.y,o[a+2]=n.z,o},f.getRow=function(e,r,n){if(!t(e))throw new i("matrix is required.");if("number"!=typeof r||0>r||r>2)throw new i("index must be 0, 1, or 2.");if(!t(n))throw new i("result is required");var o=e[r],a=e[r+3],u=e[r+6];
  return n.x=o,n.y=a,n.z=u,n},f.setRow=function(e,r,n,o){if(!t(e))throw new i("matrix is required");if(!t(n))throw new i("cartesian is required");if("number"!=typeof r||0>r||r>2)throw new i("index must be 0, 1, or 2.");if(!t(o))throw new i("result is required");return o=f.clone(e,o),o[r]=n.x,o[r+3]=n.y,o[r+6]=n.z,o};var c=new e;f.getScale=function(r,n){if(!t(r))throw new i("matrix is required.");if(!t(n))throw new i("result is required");return n.x=e.magnitude(e.fromElements(r[0],r[1],r[2],c)),n.y=e.magnitude(e.fromElements(r[3],r[4],r[5],c)),n.z=e.magnitude(e.fromElements(r[6],r[7],r[8],c)),n};var h=new e;f.getMaximumScale=function(r){return f.getScale(r,h),e.maximumComponent(h)},f.multiply=function(e,r,n){if(!t(e))throw new i("left is required");if(!t(r))throw new i("right is required");if(!t(n))throw new i("result is required");var o=e[0]*r[0]+e[3]*r[1]+e[6]*r[2],a=e[1]*r[0]+e[4]*r[1]+e[7]*r[2],u=e[2]*r[0]+e[5]*r[1]+e[8]*r[2],s=e[0]*r[3]+e[3]*r[4]+e[6]*r[5],f=e[1]*r[3]+e[4]*r[4]+e[7]*r[5],c=e[2]*r[3]+e[5]*r[4]+e[8]*r[5],h=e[0]*r[6]+e[3]*r[7]+e[6]*r[8],w=e[1]*r[6]+e[4]*r[7]+e[7]*r[8],d=e[2]*r[6]+e[5]*r[7]+e[8]*r[8];return n[0]=o,n[1]=a,n[2]=u,n[3]=s,n[4]=f,n[5]=c,n[6]=h,n[7]=w,n[8]=d,n},f.add=function(e,r,n){if(!t(e))throw new i("left is required");if(!t(r))throw new i("right is required");if(!t(n))throw new i("result is required");return n[0]=e[0]+r[0],n[1]=e[1]+r[1],n[2]=e[2]+r[2],n[3]=e[3]+r[3],n[4]=e[4]+r[4],n[5]=e[5]+r[5],n[6]=e[6]+r[6],n[7]=e[7]+r[7],n[8]=e[8]+r[8],n},f.subtract=function(e,r,n){if(!t(e))throw new i("left is required");if(!t(r))throw new i("right is required");if(!t(n))throw new i("result is required");return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],n[3]=e[3]-r[3],n[4]=e[4]-r[4],n[5]=e[5]-r[5],n[6]=e[6]-r[6],n[7]=e[7]-r[7],n[8]=e[8]-r[8],n},f.multiplyByVector=function(e,r,n){if(!t(e))throw new i("matrix is required");if(!t(r))throw new i("cartesian is required");if(!t(n))throw new i("result is required");var o=r.x,a=r.y,u=r.z,s=e[0]*o+e[3]*a+e[6]*u,f=e[1]*o+e[4]*a+e[7]*u,c=e[2]*o+e[5]*a+e[8]*u;return n.x=s,n.y=f,n.z=c,n},f.multiplyByScalar=function(e,r,n){if(!t(e))throw new i("matrix is required");if("number"!=typeof r)throw new i("scalar must be a number");if(!t(n))throw new i("result is required");return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n},f.multiplyByScale=function(e,r,n){if(!t(e))throw new i("matrix is required");if(!t(r))throw new i("scale is required");if(!t(n))throw new i("result is required");return n[0]=e[0]*r.x,n[1]=e[1]*r.x,n[2]=e[2]*r.x,n[3]=e[3]*r.y,n[4]=e[4]*r.y,n[5]=e[5]*r.y,n[6]=e[6]*r.z,n[7]=e[7]*r.z,n[8]=e[8]*r.z,n},f.negate=function(e,r){if(!t(e))throw new i("matrix is required");if(!t(r))throw new i("result is required");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},f.transpose=function(e,r){if(!t(e))throw new i("matrix is required");if(!t(r))throw new i("result is required");var n=e[0],o=e[3],a=e[6],u=e[1],s=e[4],f=e[7],c=e[2],h=e[5],w=e[8];return r[0]=n,r[1]=o,r[2]=a,r[3]=u,r[4]=s,r[5]=f,r[6]=c,r[7]=h,r[8]=w,r};var w=[1,0,0],d=[2,2,1],l=new f,m=new f;return f.computeEigenDecomposition=function(e,r){if(!t(e))throw new i("matrix is required.");var n=o.EPSILON20,c=10,h=0,w=0;t(r)||(r={});for(var d=r.unitary=f.clone(f.IDENTITY,r.unitary),p=r.diagonal=f.clone(e,r.diagonal),y=n*a(p);c>w&&u(p)>y;)s(p,l),f.transpose(l,m),f.multiply(p,l,p),f.multiply(m,p,p),f.multiply(d,l,d),++h>2&&(++w,h=0);return r},f.abs=function(e,r){if(!t(e))throw new i("matrix is required");if(!t(r))throw new i("result is required");return r[0]=Math.abs(e[0]),r[1]=Math.abs(e[1]),r[2]=Math.abs(e[2]),r[3]=Math.abs(e[3]),r[4]=Math.abs(e[4]),r[5]=Math.abs(e[5]),r[6]=Math.abs(e[6]),r[7]=Math.abs(e[7]),r[8]=Math.abs(e[8]),r},f.determinant=function(e){if(!t(e))throw new i("matrix is required");var r=e[0],n=e[3],o=e[6],a=e[1],u=e[4],s=e[7],f=e[2],c=e[5],h=e[8];return r*(u*h-c*s)+a*(c*o-n*h)+f*(n*s-u*o)},f.inverse=function(e,r){if(!t(e))throw new i("matrix is required");if(!t(r))throw new i("result is required");var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],h=e[5],w=e[6],d=e[7],l=e[8],m=f.determinant(e);if(Math.abs(m)<=o.EPSILON15)throw new i("matrix is not invertible");r[0]=c*l-d*h,r[1]=d*u-a*l,r[2]=a*h-c*u,r[3]=w*h-s*l,r[4]=n*l-w*u,r[5]=s*u-n*h,r[6]=s*d-w*c,r[7]=w*a-n*d,r[8]=n*c-s*a;var p=1/m;return f.multiplyByScalar(r,p,r)},f.equals=function(e,r){return e===r||t(e)&&t(r)&&e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]},f.equalsEpsilon=function(e,r,n){if("number"!=typeof n)throw new i("epsilon must be a number");return e===r||t(e)&&t(r)&&Math.abs(e[0]-r[0])<=n&&Math.abs(e[1]-r[1])<=n&&Math.abs(e[2]-r[2])<=n&&Math.abs(e[3]-r[3])<=n&&Math.abs(e[4]-r[4])<=n&&Math.abs(e[5]-r[5])<=n&&Math.abs(e[6]-r[6])<=n&&Math.abs(e[7]-r[7])<=n&&Math.abs(e[8]-r[8])<=n},f.IDENTITY=n(new f(1,0,0,0,1,0,0,0,1)),f.ZERO=n(new f(0,0,0,0,0,0,0,0,0)),f.COLUMN0ROW0=0,f.COLUMN0ROW1=1,f.COLUMN0ROW2=2,f.COLUMN1ROW0=3,f.COLUMN1ROW1=4,f.COLUMN1ROW2=5,f.COLUMN2ROW0=6,f.COLUMN2ROW1=7,f.COLUMN2ROW2=8,f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,r,t){return e[0]===r[t]&&e[1]===r[t+1]&&e[2]===r[t+2]&&e[3]===r[t+3]&&e[4]===r[t+4]&&e[5]===r[t+5]&&e[6]===r[t+6]&&e[7]===r[t+7]&&e[8]===r[t+8]},f.prototype.equalsEpsilon=function(e,r){return f.equalsEpsilon(this,e,r)},f.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},f}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var r=function(e){this.name="RuntimeError",this.message=e;var r;try{throw new Error}catch(t){r=t.stack}this.stack=r};return r.prototype.toString=function(){var r=this.name+": "+this.message;return e(this.stack)&&(r+="\n"+this.stack.toString()),r},r}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,r,t,i,n,o,a,u,s){"use strict";var f=function(e,r,i,n,o,a,u,s,f,c,h,w,d,l,m,p){this[0]=t(e,0),this[1]=t(o,0),this[2]=t(f,0),this[3]=t(d,0),this[4]=t(r,0),this[5]=t(a,0),this[6]=t(c,0),this[7]=t(l,0),this[8]=t(i,0),this[9]=t(u,0),this[10]=t(h,0),this[11]=t(m,0),this[12]=t(n,0),this[13]=t(s,0),this[14]=t(w,0),this[15]=t(p,0)};f.packedLength=16,f.pack=function(e,r,o){if(!i(e))throw new n("value is required");if(!i(r))throw new n("array is required");o=t(o,0),r[o++]=e[0],r[o++]=e[1],r[o++]=e[2],r[o++]=e[3],r[o++]=e[4],r[o++]=e[5],r[o++]=e[6],r[o++]=e[7],r[o++]=e[8],r[o++]=e[9],r[o++]=e[10],r[o++]=e[11],r[o++]=e[12],r[o++]=e[13],r[o++]=e[14],r[o]=e[15]},f.unpack=function(e,r,o){if(!i(e))throw new n("array is required");return r=t(r,0),i(o)||(o=new f),o[0]=e[r++],o[1]=e[r++],o[2]=e[r++],o[3]=e[r++],o[4]=e[r++],o[5]=e[r++],o[6]=e[r++],o[7]=e[r++],o[8]=e[r++],o[9]=e[r++],o[10]=e[r++],o[11]=e[r++],o[12]=e[r++],o[13]=e[r++],o[14]=e[r++],o[15]=e[r],o},f.clone=function(e,r){return i(e)?i(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r):new f(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},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,r){if(!i(e))throw new n("values is required");return f.clone(e,r)},f.fromRowMajorArray=function(e,r){if(!i(e))throw new n("values is required.");return i(r)?(r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15],r):new f(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])},f.fromRotationTranslation=function(r,o,a){if(!i(r))throw new n("rotation is required.");return o=t(o,e.ZERO),i(a)?(a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=0,a[4]=r[3],a[5]=r[4],a[6]=r[5],a[7]=0,a[8]=r[6],a[9]=r[7],a[10]=r[8],a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a):new f(r[0],r[3],r[6],o.x,r[1],r[4],r[7],o.y,r[2],r[5],r[8],o.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,r,t,o){if(!i(e))throw new n("translation is required.");if(!i(r))throw new n("rotation is required.");if(!i(t))throw new n("scale is required.");i(o)||(o=new f);var a=t.x,u=t.y,s=t.z,c=r.x*r.x,h=r.x*r.y,w=r.x*r.z,d=r.x*r.w,l=r.y*r.y,m=r.y*r.z,p=r.y*r.w,y=r.z*r.z,q=r.z*r.w,v=r.w*r.w,g=c-l-y+v,E=2*(h-q),x=2*(w+p),b=2*(h+q),S=-c+l-y+v,M=2*(m-d),O=2*(w-p),_=2*(m+d),z=-c-l+y+v;return o[0]=g*a,o[1]=b*a,o[2]=O*a,o[3]=0,o[4]=E*u,o[5]=S*u,o[6]=_*u,o[7]=0,o[8]=x*s,o[9]=M*s,o[10]=z*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o},f.fromTranslation=function(e,r){if(!i(e))throw new n("translation is required.");return f.fromRotationTranslation(u.IDENTITY,e,r)},f.fromScale=function(e,r){if(!i(e))throw new n("scale is required.");return i(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e.y,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e.z,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):new f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,r){if("number"!=typeof e)throw new n("scale is required.");return i(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):new f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,h=new e,w=new e;f.fromCamera=function(r,t){if(!i(r))throw new n("camera is required.");var o=r.eye,a=r.target,u=r.up;if(!i(o))throw new n("camera.eye is required.");if(!i(a))throw new n("camera.target is required.");if(!i(u))throw new n("camera.up is required.");e.normalize(e.subtract(a,o,c),c),e.normalize(e.cross(c,u,h),h),e.normalize(e.cross(h,c,w),w);var s=h.x,d=h.y,l=h.z,m=c.x,p=c.y,y=c.z,q=w.x,v=w.y,g=w.z,E=o.x,x=o.y,b=o.z,S=s*-E+d*-x+l*-b,M=q*-E+v*-x+g*-b,O=m*E+p*x+y*b;return i(t)?(t[0]=s,t[1]=q,t[2]=-m,t[3]=0,t[4]=d,t[5]=v,t[6]=-p,t[7]=0,t[8]=l,t[9]=g,t[10]=-y,t[11]=0,t[12]=S,t[13]=M,t[14]=O,t[15]=1,t):new f(s,d,l,S,q,v,g,M,-m,-p,-y,O,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,r,t,o,a){if(0>=e||e>Math.PI)throw new n("fovY must be in [0, PI).");if(0>=r)throw new n("aspectRatio must be greater than zero.");if(0>=t)throw new n("near must be greater than zero.");if(0>=o)throw new n("far must be greater than zero.");if(!i(a))throw new n("result is required");var u=Math.tan(.5*e),s=1/u,f=s/r,c=(o+t)/(t-o),h=2*o*t/(t-o);return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=s,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=c,a[11]=-1,a[12]=0,a[13]=0,a[14]=h,a[15]=0,a},f.computeOrthographicOffCenter=function(e,r,t,o,a,u,s){if(!i(e))throw new n("left is required.");if(!i(r))throw new n("right is required.");if(!i(t))throw new n("bottom is required.");if(!i(o))throw new n("top is required.");if(!i(a))throw new n("near is required.");if(!i(u))throw new n("far is required.");if(!i(s))throw new n("result is required");var f=1/(r-e),c=1/(o-t),h=1/(u-a),w=-(r+e)*f,d=-(o+t)*c,l=-(u+a)*h;return f*=2,c*=2,h*=-2,s[0]=f,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=h,s[11]=0,s[12]=w,s[13]=d,s[14]=l,s[15]=1,s},f.computePerspectiveOffCenter=function(e,r,t,o,a,u,s){if(!i(e))throw new n("left is required.");if(!i(r))throw new n("right is required.");if(!i(t))throw new n("bottom is required.");if(!i(o))throw new n("top is required.");if(!i(a))throw new n("near is required.");if(!i(u))throw new n("far is required.");if(!i(s))throw new n("result is required");var f=2*a/(r-e),c=2*a/(o-t),h=(r+e)/(r-e),w=(o+t)/(o-t),d=-(u+a)/(u-a),l=-1,m=-2*u*a/(u-a);return s[0]=f,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=h,s[9]=w,s[10]=d,s[11]=l,s[12]=0,s[13]=0,s[14]=m,s[15]=0,s},f.computeInfinitePerspectiveOffCenter=function(e,r,t,o,a,u){if(!i(e))throw new n("left is required.");if(!i(r))throw new n("right is required.");if(!i(t))throw new n("bottom is required.");if(!i(o))throw new n("top is required.");if(!i(a))throw new n("near is required.");if(!i(u))throw new n("result is required");var s=2*a/(r-e),f=2*a/(o-t),c=(r+e)/(r-e),h=(o+t)/(o-t),w=-1,d=-1,l=-2*a;return u[0]=s,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=f,u[6]=0,u[7]=0,u[8]=c,u[9]=h,u[10]=w,u[11]=d,u[12]=0,u[13]=0,u[14]=l,u[15]=0,u},f.computeViewportTransformation=function(e,r,o,a){if(!i(a))throw new n("result is required");e=t(e,t.EMPTY_OBJECT);var u=t(e.x,0),s=t(e.y,0),f=t(e.width,0),c=t(e.height,0);r=t(r,0),o=t(o,1);var h=.5*f,w=.5*c,d=.5*(o-r),l=h,m=w,p=d,y=u+h,q=s+w,v=r+d,g=1;return a[0]=l,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=m,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=y,a[13]=q,a[14]=v,a[15]=g,a},f.toArray=function(e,r){if(!i(e))throw new n("matrix is required");return i(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},f.getElementIndex=function(e,r){if("number"!=typeof r||0>r||r>3)throw new n("row must be 0, 1, 2, or 3.");if("number"!=typeof e||0>e||e>3)throw new n("column must be 0, 1, 2, or 3.");return 4*e+r},f.getColumn=function(e,r,t){if(!i(e))throw new n("matrix is required.");if("number"!=typeof r||0>r||r>3)throw new n("index must be 0, 1, 2, or 3.");if(!i(t))throw new n("result is required");var o=4*r,a=e[o],u=e[o+1],s=e[o+2],f=e[o+3];return t.x=a,t.y=u,t.z=s,t.w=f,t},f.setColumn=function(e,r,t,o){if(!i(e))throw new n("matrix is required");if(!i(t))throw new n("cartesian is required");if("number"!=typeof r||0>r||r>3)throw new n("index must be 0, 1, 2, or 3.");if(!i(o))throw new n("result is required");o=f.clone(e,o);var a=4*r;return o[a]=t.x,o[a+1]=t.y,o[a+2]=t.z,o[a+3]=t.w,o},f.setTranslation=function(e,r,t){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("translation is required");if(!i(t))throw new n("result is required");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]=r.x,t[13]=r.y,t[14]=r.z,t[15]=e[15],t},f.getRow=function(e,r,t){if(!i(e))throw new n("matrix is required.");if("number"!=typeof r||0>r||r>3)throw new n("index must be 0, 1, 2, or 3.");if(!i(t))throw new n("result is required");var o=e[r],a=e[r+4],u=e[r+8],s=e[r+12];return t.x=o,t.y=a,t.z=u,t.w=s,t},f.setRow=function(e,r,t,o){if(!i(e))throw new n("matrix is required");if(!i(t))throw new n("cartesian is required");if("number"!=typeof r||0>r||r>3)throw new n("index must be 0, 1, 2, or 3.");if(!i(o))throw new n("result is required");return o=f.clone(e,o),o[r]=t.x,o[r+4]=t.y,o[r+8]=t.z,o[r+12]=t.w,o};var d=new e;f.getScale=function(r,t){if(!i(r))throw new n("matrix is required.");if(!i(t))throw new n("result is required");return t.x=e.magnitude(e.fromElements(r[0],r[1],r[2],d)),t.y=e.magnitude(e.fromElements(r[4],r[5],r[6],d)),t.z=e.magnitude(e.fromElements(r[8],r[9],r[10],d)),t};var l=new e;f.getMaximumScale=function(r){return f.getScale(r,l),e.maximumComponent(l)},f.multiply=function(e,r,t){if(!i(e))throw new n("left is required");if(!i(r))throw new n("right is required");if(!i(t))throw new n("result is required");var o=e[0],a=e[1],u=e[2],s=e[3],f=e[4],c=e[5],h=e[6],w=e[7],d=e[8],l=e[9],m=e[10],p=e[11],y=e[12],q=e[13],v=e[14],g=e[15],E=r[0],x=r[1],b=r[2],S=r[3],M=r[4],O=r[5],_=r[6],z=r[7],I=r[8],T=r[9],N=r[10],P=r[11],R=r[12],A=r[13],C=r[14],L=r[15],U=o*E+f*x+d*b+y*S,D=a*E+c*x+l*b+q*S,B=u*E+h*x+m*b+v*S,W=s*E+w*x+p*b+g*S,k=o*M+f*O+d*_+y*z,F=a*M+c*O+l*_+q*z,G=u*M+h*O+m*_+v*z,V=s*M+w*O+p*_+g*z,Y=o*I+f*T+d*N+y*P,j=a*I+c*T+l*N+q*P,H=u*I+h*T+m*N+v*P,Z=s*I+w*T+p*N+g*P,X=o*R+f*A+d*C+y*L,K=a*R+c*A+l*C+q*L,J=u*R+h*A+m*C+v*L,Q=s*R+w*A+p*C+g*L;return t[0]=U,t[1]=D,t[2]=B,t[3]=W,t[4]=k,t[5]=F,t[6]=G,t[7]=V,t[8]=Y,t[9]=j,t[10]=H,t[11]=Z,t[12]=X,t[13]=K,t[14]=J,t[15]=Q,t},f.add=function(e,r,t){if(!i(e))throw new n("left is required");if(!i(r))throw new n("right is required");if(!i(t))throw new n("result is required");return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t},f.subtract=function(e,r,t){if(!i(e))throw new n("left is required");if(!i(r))throw new n("right is required");if(!i(t))throw new n("result is required");return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t},f.multiplyTransformation=function(e,r,t){if(!i(e))throw new n("left is required");if(!i(r))throw new n("right is required");if(!i(t))throw new n("result is required");var o=e[0],a=e[1],u=e[2],s=e[4],f=e[5],c=e[6],h=e[8],w=e[9],d=e[10],l=e[12],m=e[13],p=e[14],y=r[0],q=r[1],v=r[2],g=r[4],E=r[5],x=r[6],b=r[8],S=r[9],M=r[10],O=r[12],_=r[13],z=r[14],I=o*y+s*q+h*v,T=a*y+f*q+w*v,N=u*y+c*q+d*v,P=o*g+s*E+h*x,R=a*g+f*E+w*x,A=u*g+c*E+d*x,C=o*b+s*S+h*M,L=a*b+f*S+w*M,U=u*b+c*S+d*M,D=o*O+s*_+h*z+l,B=a*O+f*_+w*z+m,W=u*O+c*_+d*z+p;return t[0]=I,t[1]=T,t[2]=N,t[3]=0,t[4]=P,t[5]=R,t[6]=A,t[7]=0,t[8]=C,t[9]=L,t[10]=U,t[11]=0,t[12]=D,t[13]=B,t[14]=W,t[15]=1,t},f.multiplyByMatrix3=function(e,r,t){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("rotation is required");if(!i(t))throw new n("result is required");var o=e[0],a=e[1],u=e[2],s=e[4],f=e[5],c=e[6],h=e[8],w=e[9],d=e[10],l=r[0],m=r[1],p=r[2],y=r[3],q=r[4],v=r[5],g=r[6],E=r[7],x=r[8],b=o*l+s*m+h*p,S=a*l+f*m+w*p,M=u*l+c*m+d*p,O=o*y+s*q+h*v,_=a*y+f*q+w*v,z=u*y+c*q+d*v,I=o*g+s*E+h*x,T=a*g+f*E+w*x,N=u*g+c*E+d*x;return t[0]=b,t[1]=S,t[2]=M,t[3]=0,t[4]=O,t[5]=_,t[6]=z,t[7]=0,t[8]=I,t[9]=T,t[10]=N,t[11]=0,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},f.multiplyByTranslation=function(e,r,t){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("translation is required");if(!i(t))throw new n("result is required");var o=r.x,a=r.y,u=r.z,s=o*e[0]+a*e[4]+u*e[8]+e[12],f=o*e[1]+a*e[5]+u*e[9]+e[13],c=o*e[2]+a*e[6]+u*e[10]+e[14];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]=s,t[13]=f,t[14]=c,t[15]=e[15],t};var m=new e;f.multiplyByUniformScale=function(e,r,t){if(!i(e))throw new n("matrix is required");if("number"!=typeof r)throw new n("scale is required");if(!i(t))throw new n("result is required");return m.x=r,m.y=r,m.z=r,f.multiplyByScale(e,m,t)},f.multiplyByScale=function(e,r,t){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("scale is required");if(!i(t))throw new n("result is required");var o=r.x,a=r.y,u=r.z;return 1===o&&1===a&&1===u?f.clone(e,t):(t[0]=o*e[0],t[1]=o*e[1],t[2]=o*e[2],t[3]=0,t[4]=a*e[4],t[5]=a*e[5],t[6]=a*e[6],t[7]=0,t[8]=u*e[8],t[9]=u*e[9],t[10]=u*e[10],t[11]=0,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=1,t)},f.multiplyByVector=function(e,r,t){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("cartesian is required");if(!i(t))throw new n("result is required");var o=r.x,a=r.y,u=r.z,s=r.w,f=e[0]*o+e[4]*a+e[8]*u+e[12]*s,c=e[1]*o+e[5]*a+e[9]*u+e[13]*s,h=e[2]*o+e[6]*a+e[10]*u+e[14]*s,w=e[3]*o+e[7]*a+e[11]*u+e[15]*s;return t.x=f,t.y=c,t.z=h,t.w=w,t},f.multiplyByPointAsVector=function(e,r,t){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("cartesian is required");if(!i(t))throw new n("result is required");var o=r.x,a=r.y,u=r.z,s=e[0]*o+e[4]*a+e[8]*u,f=e[1]*o+e[5]*a+e[9]*u,c=e[2]*o+e[6]*a+e[10]*u;return t.x=s,t.y=f,t.z=c,t},f.multiplyByPoint=function(e,r,t){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("cartesian is required");if(!i(t))throw new n("result is required");var o=r.x,a=r.y,u=r.z,s=e[0]*o+e[4]*a+e[8]*u+e[12],f=e[1]*o+e[5]*a+e[9]*u+e[13],c=e[2]*o+e[6]*a+e[10]*u+e[14];return t.x=s,t.y=f,t.z=c,t},f.multiplyByScalar=function(e,r,t){if(!i(e))throw new n("matrix is required");if("number"!=typeof r)throw new n("scalar must be a number");if(!i(t))throw new n("result is required");return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t},f.negate=function(e,r){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("result is required");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]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=-e[15],r},f.transpose=function(e,r){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("result is required");var t=e[1],o=e[2],a=e[3],u=e[6],s=e[7],f=e[11];return r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=o,r[9]=u,r[10]=e[10],r[11]=e[14],r[12]=a,r[13]=s,r[14]=f,r[15]=e[15],r},f.abs=function(e,r){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("result is required");return r[0]=Math.abs(e[0]),r[1]=Math.abs(e[1]),r[2]=Math.abs(e[2]),r[3]=Math.abs(e[3]),r[4]=Math.abs(e[4]),r[5]=Math.abs(e[5]),r[6]=Math.abs(e[6]),r[7]=Math.abs(e[7]),r[8]=Math.abs(e[8]),r[9]=Math.abs(e[9]),r[10]=Math.abs(e[10]),r[11]=Math.abs(e[11]),r[12]=Math.abs(e[12]),r[13]=Math.abs(e[13]),r[14]=Math.abs(e[14]),r[15]=Math.abs(e[15]),r},f.equals=function(e,r){return e===r||i(e)&&i(r)&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[3]===r[3]&&e[7]===r[7]&&e[11]===r[11]&&e[15]===r[15]},f.equalsEpsilon=function(e,r,t){if("number"!=typeof t)throw new n("epsilon must be a number");return e===r||i(e)&&i(r)&&Math.abs(e[0]-r[0])<=t&&Math.abs(e[1]-r[1])<=t&&Math.abs(e[2]-r[2])<=t&&Math.abs(e[3]-r[3])<=t&&Math.abs(e[4]-r[4])<=t&&Math.abs(e[5]-r[5])<=t&&Math.abs(e[6]-r[6])<=t&&Math.abs(e[7]-r[7])<=t&&Math.abs(e[8]-r[8])<=t&&Math.abs(e[9]-r[9])<=t&&Math.abs(e[10]-r[10])<=t&&Math.abs(e[11]-r[11])<=t&&Math.abs(e[12]-r[12])<=t&&Math.abs(e[13]-r[13])<=t&&Math.abs(e[14]-r[14])<=t&&Math.abs(e[15]-r[15])<=t},f.getTranslation=function(e,r){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("result is required");return r.x=e[12],r.y=e[13],r.z=e[14],r},f.getRotation=function(e,r){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("result is required");return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[4],r[4]=e[5],r[5]=e[6],r[6]=e[8],r[7]=e[9],r[8]=e[10],r};var p=new u,y=new u,q=new r,v=new r(0,0,0,1);return f.inverse=function(e,t){if(!i(e))throw new n("matrix is required");if(!i(t))throw new n("result is required");if(u.equalsEpsilon(f.getRotation(e,p),y,a.EPSILON7)&&r.equals(f.getRow(e,3,q),v))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;var o=e[0],c=e[4],h=e[8],w=e[12],d=e[1],l=e[5],m=e[9],g=e[13],E=e[2],x=e[6],b=e[10],S=e[14],M=e[3],O=e[7],_=e[11],z=e[15],I=b*z,T=S*_,N=x*z,P=S*O,R=x*_,A=b*O,C=E*z,L=S*M,U=E*_,D=b*M,B=E*O,W=x*M,k=I*l+P*m+R*g-(T*l+N*m+A*g),F=T*d+C*m+D*g-(I*d+L*m+U*g),G=N*d+L*l+B*g-(P*d+C*l+W*g),V=A*d+U*l+W*m-(R*d+D*l+B*m),Y=T*c+N*h+A*w-(I*c+P*h+R*w),j=I*o+L*h+U*w-(T*o+C*h+D*w),H=P*o+C*c+W*w-(N*o+L*c+B*w),Z=R*o+D*c+B*h-(A*o+U*c+W*h);I=h*g,T=w*m,N=c*g,P=w*l,R=c*m,A=h*l,C=o*g,L=w*d,U=o*m,D=h*d,B=o*l,W=c*d;var X=I*O+P*_+R*z-(T*O+N*_+A*z),K=T*M+C*_+D*z-(I*M+L*_+U*z),J=N*M+L*O+B*z-(P*M+C*O+W*z),Q=A*M+U*O+W*_-(R*M+D*O+B*_),$=N*b+A*S+T*x-(R*S+I*x+P*b),er=U*S+I*E+L*b-(C*b+D*S+T*E),rr=C*x+W*S+P*E-(B*S+N*E+L*x),tr=B*b+R*E+D*x-(U*x+W*b+A*E),ir=o*k+c*F+h*G+w*V;if(Math.abs(ir)<a.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ir=1/ir,t[0]=k*ir,t[1]=F*ir,t[2]=G*ir,t[3]=V*ir,t[4]=Y*ir,t[5]=j*ir,t[6]=H*ir,t[7]=Z*ir,t[8]=X*ir,t[9]=K*ir,t[10]=J*ir,t[11]=Q*ir,t[12]=$*ir,t[13]=er*ir,t[14]=rr*ir,t[15]=tr*ir,t},f.inverseTransformation=function(e,r){if(!i(e))throw new n("matrix is required");if(!i(r))throw new n("result is required");var t=e[0],o=e[1],a=e[2],u=e[4],s=e[5],f=e[6],c=e[8],h=e[9],w=e[10],d=e[12],l=e[13],m=e[14],p=-t*d-o*l-a*m,y=-u*d-s*l-f*m,q=-c*d-h*l-w*m;return r[0]=t,r[1]=u,r[2]=c,r[3]=0,r[4]=o,r[5]=s,r[6]=h,r[7]=0,r[8]=a,r[9]=f,r[10]=w,r[11]=0,r[12]=p,r[13]=y,r[14]=q,r[15]=1,r},f.IDENTITY=o(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=o(new f(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),f.COLUMN0ROW0=0,f.COLUMN0ROW1=1,f.COLUMN0ROW2=2,f.COLUMN0ROW3=3,f.COLUMN1ROW0=4,f.COLUMN1ROW1=5,f.COLUMN1ROW2=6,f.COLUMN1ROW3=7,f.COLUMN2ROW0=8,f.COLUMN2ROW1=9,f.COLUMN2ROW2=10,f.COLUMN2ROW3=11,f.COLUMN3ROW0=12,f.COLUMN3ROW1=13,f.COLUMN3ROW2=14,f.COLUMN3ROW3=15,f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,r,t){return e[0]===r[t]&&e[1]===r[t+1]&&e[2]===r[t+2]&&e[3]===r[t+3]&&e[4]===r[t+4]&&e[5]===r[t+5]&&e[6]===r[t+6]&&e[7]===r[t+7]&&e[8]===r[t+8]&&e[9]===r[t+9]&&e[10]===r[t+10]&&e[11]===r[t+11]&&e[12]===r[t+12]&&e[13]===r[t+13]&&e[14]===r[t+14]&&e[15]===r[t+15]},f.prototype.equalsEpsilon=function(e,r){return f.equalsEpsilon(this,e,r)},f.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]+")"},f}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,r,t,i){"use strict";var n=function(i,n){if(!r(i))throw new t("normal is required.");if(!r(n))throw new t("distance is required.");this.normal=e.clone(i),this.distance=n};n.fromPointNormal=function(i,o,a){if(!r(i))throw new t("point is required.");if(!r(o))throw new t("normal is required.");var u=-e.dot(o,i);return r(a)?(e.clone(o,a.normal),a.distance=u,a):new n(o,u)};var o=new e;return n.fromCartesian4=function(i,a){if(!r(i))throw new t("coefficients is required.");var u=e.fromCartesian4(i,o),s=i.w;return r(a)?(e.clone(u,a.normal),a.distance=s,a):new n(u,s)},n.getPointDistance=function(i,n){if(!r(i))throw new t("plane is required.");if(!r(n))throw new t("point is required.");return e.dot(i.normal,n)+i.distance},n.ORIGIN_XY_PLANE=i(new n(e.UNIT_Z,0)),n.ORIGIN_YZ_PLANE=i(new n(e.UNIT_X,0)),n.ORIGIN_ZX_PLANE=i(new n(e.UNIT_Y,0)),n}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,r,t,i,n,o,a,u){"use strict";var s=function(e,t,i,n){this.west=r(e,0),this.south=r(t,0),this.east=r(i,0),this.north=r(n,0)};i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,i,o){if(!t(e))throw new n("value is required");if(!t(i))throw new n("array is required");o=r(o,0),i[o++]=e.west,i[o++]=e.south,i[o++]=e.east,i[o]=e.north},s.unpack=function(e,i,o){if(!t(e))throw new n("array is required");return i=r(i,0),t(o)||(o=new s),o.west=e[i++],o.south=e[i++],o.east=e[i++],o.north=e[i],o},s.computeWidth=function(e){if(!t(e))throw new n("rectangle is required.");var r=e.east,i=e.west;return i>r&&(r+=u.TWO_PI),r-i},s.computeHeight=function(e){if(!t(e))throw new n("rectangle is required.");return e.north-e.south},s.fromDegrees=function(e,i,n,o,a){return e=u.toRadians(r(e,0)),i=u.toRadians(r(i,0)),n=u.toRadians(r(n,0)),o=u.toRadians(r(o,0)),t(a)?(a.west=e,a.south=i,a.east=n,a.north=o,a):new s(e,i,n,o)},s.fromCartographicArray=function(e,r){if(!t(e))throw new n("cartographics is required.");for(var i=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE,f=0,c=e.length;c>f;f++){var h=e[f];i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),u=Math.max(u,h.latitude)}return t(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new s(i,a,o,u)},s.clone=function(e,r){return t(e)?t(r)?(r.west=e.west,r.south=e.south,r.east=e.east,r.north=e.north,r):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,r){return e===r||t(e)&&t(r)&&e.west===r.west&&e.south===r.south&&e.east===r.east&&e.north===r.north},s.prototype.equalsEpsilon=function(e,r){if("number"!=typeof r)throw new n("epsilon is required and must be a number.");return t(e)&&Math.abs(this.west-e.west)<=r&&Math.abs(this.south-e.south)<=r&&Math.abs(this.east-e.east)<=r&&Math.abs(this.north-e.north)<=r},s.validate=function(e){if(!t(e))throw new n("rectangle is required");var r=e.north;if("number"!=typeof r)throw new n("north is required to be a number.");if(r<-u.PI_OVER_TWO||r>u.PI_OVER_TWO)throw new n("north must be in the interval [-Pi/2, Pi/2].");var i=e.south;if("number"!=typeof i)throw new n("south is required to be a number.");if(i<-u.PI_OVER_TWO||i>u.PI_OVER_TWO)throw new n("south must be in the interval [-Pi/2, Pi/2].");var o=e.west;if("number"!=typeof o)throw new n("west is required to be a number.");if(o<-Math.PI||o>Math.PI)throw new n("west must be in the interval [-Pi, Pi].");var a=e.east;if("number"!=typeof a)throw new n("east is required to be a number.");if(a<-Math.PI||a>Math.PI)throw new n("east must be in the interval [-Pi, Pi].")},s.southwest=function(r,i){if(!t(r))throw new n("rectangle is required");return t(i)?(i.longitude=r.west,i.latitude=r.south,i.height=0,i):new e(r.west,r.south)},s.northwest=function(r,i){if(!t(r))throw new n("rectangle is required");return t(i)?(i.longitude=r.west,i.latitude=r.north,i.height=0,i):new e(r.west,r.north)},s.northeast=function(r,i){if(!t(r))throw new n("rectangle is required");return t(i)?(i.longitude=r.east,i.latitude=r.north,i.height=0,i):new e(r.east,r.north)},s.southeast=function(r,i){if(!t(r))throw new n("rectangle is required");return t(i)?(i.longitude=r.east,i.latitude=r.south,i.height=0,i):new e(r.east,r.south)},s.center=function(r,i){if(!t(r))throw new n("rectangle is required");var o=r.east,a=r.west;a>o&&(o+=u.TWO_PI);var s=u.negativePiToPi(.5*(a+o)),f=.5*(r.south+r.north);return t(i)?(i.longitude=s,i.latitude=f,i.height=0,i):new e(s,f)},s.intersection=function(e,r,i){if(!t(e))throw new n("rectangle is required");if(!t(r))throw new n("otherRectangle is required.");var o=e.east,a=e.west,f=r.east,c=r.west;a>o&&f>0?o+=u.TWO_PI:c>f&&o>0&&(f+=u.TWO_PI),a>o&&0>c?c+=u.TWO_PI:c>f&&0>a&&(a+=u.TWO_PI);var h=u.negativePiToPi(Math.max(a,c)),w=u.negativePiToPi(Math.min(o,f));if((e.west<e.east||r.west<r.east)&&h>=w)return void 0;var d=Math.max(e.south,r.south),l=Math.min(e.north,r.north);return d>=l?void 0:t(i)?(i.west=h,i.south=d,i.east=w,i.north=l,i):new s(h,d,w,l)},s.contains=function(e,r){if(!t(e))throw new n("rectangle is required");if(!t(r))throw new n("cartographic is required.");var i=r.longitude,o=r.latitude,a=e.west,s=e.east;return a>s&&(s+=u.TWO_PI,0>i&&(i+=u.TWO_PI)),(i>a||u.equalsEpsilon(i,a,u.EPSILON14))&&(s>i||u.equalsEpsilon(i,s,u.EPSILON14))&&o>=e.south&&o<=e.north};var f=new e;return s.subsample=function(e,i,a,c){if(!t(e))throw new n("rectangle is required");i=r(i,o.WGS84),a=r(a,0),t(c)||(c=[]);var h=0,w=e.north,d=e.south,l=e.east,m=e.west,p=f;p.height=a,p.longitude=m,p.latitude=w,c[h]=i.cartographicToCartesian(p,c[h]),h++,p.longitude=l,c[h]=i.cartographicToCartesian(p,c[h]),h++,p.latitude=d,c[h]=i.cartographicToCartesian(p,c[h]),h++,p.longitude=m,c[h]=i.cartographicToCartesian(p,c[h]),h++,p.latitude=0>w?w:d>0?d:0;for(var y=1;8>y;++y)p.longitude=-Math.PI+y*u.PI_OVER_TWO,s.contains(e,p)&&(c[h]=i.cartographicToCartesian(p,c[h]),h++);return 0===p.latitude&&(p.longitude=m,c[h]=i.cartographicToCartesian(p,c[h]),h++,p.longitude=l,c[h]=i.cartographicToCartesian(p,c[h]),h++),c.length=h,c},s.MAX_VALUE=a(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Plane","./Rectangle"],function(e,r,t,i,n,o,a,u,s,f,c,h,w){"use strict";
  var d=function(r,i){this.center=e.clone(t(r,e.ZERO)),this.radius=t(i,0)},l=new e,m=new e,p=new e,y=new e,q=new e,v=new e,g=new e,E=new e,x=new e,b=new e,S=new e,M=new e;d.fromPoints=function(r,t){if(i(t)||(t=new d),!i(r)||0===r.length)return t.center=e.clone(e.ZERO,t.center),t.radius=0,t;for(var n=e.clone(r[0],g),o=e.clone(n,l),a=e.clone(n,m),u=e.clone(n,p),s=e.clone(n,y),f=e.clone(n,q),c=e.clone(n,v),h=r.length,w=1;h>w;w++){e.clone(r[w],n);var O=n.x,_=n.y,z=n.z;O<o.x&&e.clone(n,o),O>s.x&&e.clone(n,s),_<a.y&&e.clone(n,a),_>f.y&&e.clone(n,f),z<u.z&&e.clone(n,u),z>c.z&&e.clone(n,c)}var I=e.magnitudeSquared(e.subtract(s,o,E)),T=e.magnitudeSquared(e.subtract(f,a,E)),N=e.magnitudeSquared(e.subtract(c,u,E)),P=o,R=s,A=I;T>A&&(A=T,P=a,R=f),N>A&&(A=N,P=u,R=c);var C=x;C.x=.5*(P.x+R.x),C.y=.5*(P.y+R.y),C.z=.5*(P.z+R.z);var L=e.magnitudeSquared(e.subtract(R,C,E)),U=Math.sqrt(L),D=b;D.x=o.x,D.y=a.y,D.z=u.z;var B=S;B.x=s.x,B.y=f.y,B.z=c.z;var W=e.multiplyByScalar(e.add(D,B,E),.5,M),k=0;for(w=0;h>w;w++){e.clone(r[w],n);var F=e.magnitude(e.subtract(n,W,E));F>k&&(k=F);var G=e.magnitudeSquared(e.subtract(n,C,E));if(G>L){var V=Math.sqrt(G);U=.5*(U+V),L=U*U;var Y=V-U;C.x=(U*C.x+Y*n.x)/V,C.y=(U*C.y+Y*n.y)/V,C.z=(U*C.z+Y*n.z)/V}}return k>U?(e.clone(C,t.center),t.radius=U):(e.clone(W,t.center),t.radius=k),t};var O=new u,_=new e,z=new e,I=new r,T=new r;d.fromRectangle2D=function(e,r,t){return d.fromRectangleWithHeights2D(e,r,0,0,t)},d.fromRectangleWithHeights2D=function(r,n,o,a,u){if(i(u)||(u=new d),!i(r))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=t(n,O),w.southwest(r,I),I.height=o,w.northeast(r,T),T.height=a;var s=n.project(I,_),f=n.project(T,z),c=f.x-s.x,h=f.y-s.y,l=f.z-s.z;u.radius=.5*Math.sqrt(c*c+h*h+l*l);var m=u.center;return m.x=s.x+.5*c,m.y=s.y+.5*h,m.z=s.z+.5*l,u};var N=[];d.fromRectangle3D=function(e,r,n,o){r=t(r,a.WGS84),n=t(n,0);var u;return i(e)&&(u=w.subsample(e,r,n,N)),d.fromPoints(u,o)},d.fromVertices=function(r,n,a,u){if(i(u)||(u=new d),!i(r)||0===r.length)return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;if(n=t(n,e.ZERO),a=t(a,3),3>a)throw new o("stride must be 3 or greater.");var s=g;s.x=r[0]+n.x,s.y=r[1]+n.y,s.z=r[2]+n.z;for(var f=e.clone(s,l),c=e.clone(s,m),h=e.clone(s,p),w=e.clone(s,y),O=e.clone(s,q),_=e.clone(s,v),z=r.length,I=0;z>I;I+=a){var T=r[I]+n.x,N=r[I+1]+n.y,P=r[I+2]+n.z;s.x=T,s.y=N,s.z=P,T<f.x&&e.clone(s,f),T>w.x&&e.clone(s,w),N<c.y&&e.clone(s,c),N>O.y&&e.clone(s,O),P<h.z&&e.clone(s,h),P>_.z&&e.clone(s,_)}var R=e.magnitudeSquared(e.subtract(w,f,E)),A=e.magnitudeSquared(e.subtract(O,c,E)),C=e.magnitudeSquared(e.subtract(_,h,E)),L=f,U=w,D=R;A>D&&(D=A,L=c,U=O),C>D&&(D=C,L=h,U=_);var B=x;B.x=.5*(L.x+U.x),B.y=.5*(L.y+U.y),B.z=.5*(L.z+U.z);var W=e.magnitudeSquared(e.subtract(U,B,E)),k=Math.sqrt(W),F=b;F.x=f.x,F.y=c.y,F.z=h.z;var G=S;G.x=w.x,G.y=O.y,G.z=_.z;var V=e.multiplyByScalar(e.add(F,G,E),.5,M),Y=0;for(I=0;z>I;I+=a){s.x=r[I]+n.x,s.y=r[I+1]+n.y,s.z=r[I+2]+n.z;var j=e.magnitude(e.subtract(s,V,E));j>Y&&(Y=j);var H=e.magnitudeSquared(e.subtract(s,B,E));if(H>W){var Z=Math.sqrt(H);k=.5*(k+Z),W=k*k;var X=Z-k;B.x=(k*B.x+X*s.x)/Z,B.y=(k*B.y+X*s.y)/Z,B.z=(k*B.z+X*s.z)/Z}}return Y>k?(e.clone(B,u.center),u.radius=k):(e.clone(V,u.center),u.radius=Y),u},d.fromCornerPoints=function(r,t,n){if(!i(r)||!i(t))throw new o("corner and oppositeCorner are required.");i(n)||(n=new d);var a=n.center;return e.add(r,t,a),e.multiplyByScalar(a,.5,a),n.radius=e.distance(a,t),n},d.fromEllipsoid=function(r,t){if(!i(r))throw new o("ellipsoid is required.");return i(t)||(t=new d),e.clone(e.ZERO,t.center),t.radius=r.maximumRadius,t};var P=new e;d.fromBoundingSpheres=function(r,t){if(i(t)||(t=new d),!i(r)||0===r.length)return t.center=e.clone(e.ZERO,t.center),t.radius=0,t;var n=r.length;if(1===n)return d.clone(r[0],t);if(2===n)return d.union(r[0],r[1],t);for(var o=[],a=0;n>a;a++)o.push(r[a].center);t=d.fromPoints(o,t);var u=t.center,s=t.radius;for(a=0;n>a;a++){var f=r[a];s=Math.max(s,e.distance(u,f.center,P)+f.radius)}return t.radius=s,t},d.clone=function(r,t){return i(r)?i(t)?(t.center=e.clone(r.center,t.center),t.radius=r.radius,t):new d(r.center,r.radius):void 0},d.packedLength=4,d.pack=function(e,r,n){if(!i(e))throw new o("value is required");if(!i(r))throw new o("array is required");n=t(n,0);var a=e.center;r[n++]=a.x,r[n++]=a.y,r[n++]=a.z,r[n]=e.radius},d.unpack=function(e,r,n){if(!i(e))throw new o("array is required");r=t(r,0),i(n)||(n=new d);var a=n.center;return a.x=e[r++],a.y=e[r++],a.z=e[r++],n.radius=e[r],n};var R=new e,A=new e;d.union=function(r,t,n){if(!i(r))throw new o("left is required.");if(!i(t))throw new o("right is required.");i(n)||(n=new d);var a=r.center,u=r.radius,s=t.center,f=t.radius,c=e.subtract(s,a,R),h=e.magnitude(c);if(u>=h+f)return r.clone(n),n;if(f>=h+u)return t.clone(n),n;var w=.5*(u+h+f),l=e.multiplyByScalar(c,(-u+w)/h,A);return e.add(l,a,l),e.clone(l,n.center),n.radius=w,n};var C=new e;d.expand=function(r,t,n){if(!i(r))throw new o("sphere is required.");if(!i(t))throw new o("point is required.");n=d.clone(r,n);var a=e.magnitude(e.subtract(t,n.center,C));return a>n.radius&&(n.radius=a),n},d.intersectPlane=function(r,t){if(!i(r))throw new o("sphere is required.");if(!i(t))throw new o("plane is required.");var n=r.center,a=r.radius,u=t.normal,f=e.dot(u,n)+t.distance;return-a>f?s.OUTSIDE:a>f?s.INTERSECTING:s.INSIDE},d.transform=function(e,r,t){if(!i(e))throw new o("sphere is required.");if(!i(r))throw new o("transform is required.");return i(t)||(t=new d),t.center=c.multiplyByPoint(r,e.center,t.center),t.radius=c.getMaximumScale(r)*e.radius,t};var L=new e;d.distanceSquaredTo=function(r,t){if(!i(r))throw new o("sphere is required.");if(!i(t))throw new o("cartesian is required.");var n=e.subtract(r.center,t,L);return e.magnitudeSquared(n)-r.radius*r.radius},d.transformWithoutScale=function(e,r,t){if(!i(e))throw new o("sphere is required.");if(!i(r))throw new o("transform is required.");return i(t)||(t=new d),t.center=c.multiplyByPoint(r,e.center,t.center),t.radius=e.radius,t};var U=new e;d.computePlaneDistances=function(r,t,n,a){if(!i(r))throw new o("sphere is required.");if(!i(t))throw new o("position is required.");if(!i(n))throw new o("direction is required.");i(a)||(a=new f);var u=e.subtract(r.center,t,U),s=e.dot(n,u);return a.start=s-r.radius,a.stop=s+r.radius,a};for(var D=new e,B=new e,W=new e,k=new e,F=new e,G=new r,V=new Array(8),Y=0;8>Y;++Y)V[Y]=new e;var j=new u;return d.projectTo2D=function(r,n,a){if(!i(r))throw new o("sphere is required.");n=t(n,j);var u=n.ellipsoid,s=r.center,f=r.radius,c=u.geodeticSurfaceNormal(s,D),h=e.cross(e.UNIT_Z,c,B);e.normalize(h,h);var w=e.cross(c,h,W);e.normalize(w,w),e.multiplyByScalar(c,f,c),e.multiplyByScalar(w,f,w),e.multiplyByScalar(h,f,h);var l=e.negate(w,F),m=e.negate(h,k),p=V,y=p[0];e.add(c,w,y),e.add(y,h,y),y=p[1],e.add(c,w,y),e.add(y,m,y),y=p[2],e.add(c,l,y),e.add(y,m,y),y=p[3],e.add(c,l,y),e.add(y,h,y),e.negate(c,c),y=p[4],e.add(c,w,y),e.add(y,h,y),y=p[5],e.add(c,w,y),e.add(y,m,y),y=p[6],e.add(c,l,y),e.add(y,m,y),y=p[7],e.add(c,l,y),e.add(y,h,y);for(var q=p.length,v=0;q>v;++v){var g=p[v];e.add(s,g,g);var E=u.cartesianToCartographic(g,G);n.project(E,g)}a=d.fromPoints(p,a),s=a.center;var x=s.x,b=s.y,S=s.z;return s.x=S,s.y=x,s.z=b,a},d.isOccluded=function(e,r){if(!i(e))throw new o("sphere is required.");if(!i(r))throw new o("occluder is required.");return!r.isBoundingSphereVisible(e)},d.equals=function(r,t){return r===t||i(r)&&i(t)&&e.equals(r.center,t.center)&&r.radius===t.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,r,t){return d.computePlaneDistances(this,e,r,t)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,r){"use strict";var t,i={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return r(n,{element:{get:function(){return n.supportsFullscreen()?document[i.fullscreenElement]:void 0}},changeEventName:{get:function(){return n.supportsFullscreen()?i.fullscreenchange:void 0}},errorEventName:{get:function(){return n.supportsFullscreen()?i.fullscreenerror:void 0}},enabled:{get:function(){return n.supportsFullscreen()?document[i.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return n.supportsFullscreen()?null!==n.element:void 0}}}),n.supportsFullscreen=function(){if(e(t))return t;t=!1;var r=document.body;if("function"==typeof r.requestFullscreen)return i.requestFullscreen="requestFullscreen",i.exitFullscreen="exitFullscreen",i.fullscreenEnabled="fullscreenEnabled",i.fullscreenElement="fullscreenElement",i.fullscreenchange="fullscreenchange",i.fullscreenerror="fullscreenerror",t=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,u=o.length;u>a;++a){var s=o[a];n=s+"RequestFullscreen","function"==typeof r[n]?(i.requestFullscreen=n,t=!0):(n=s+"RequestFullScreen","function"==typeof r[n]&&(i.requestFullscreen=n,t=!0)),n=s+"ExitFullscreen","function"==typeof document[n]?i.exitFullscreen=n:(n=s+"CancelFullScreen","function"==typeof document[n]&&(i.exitFullscreen=n)),n=s+"FullscreenEnabled",e(document[n])?i.fullscreenEnabled=n:(n=s+"FullScreenEnabled",e(document[n])&&(i.fullscreenEnabled=n)),n=s+"FullscreenElement",e(document[n])?i.fullscreenElement=n:(n=s+"FullScreenElement",e(document[n])&&(i.fullscreenElement=n)),n=s+"fullscreenchange",e(document["on"+n])&&("ms"===s&&(n="MSFullscreenChange"),i.fullscreenchange=n),n=s+"fullscreenerror",e(document["on"+n])&&("ms"===s&&(n="MSFullscreenError"),i.fullscreenerror=n)}return t},n.requestFullscreen=function(e){n.supportsFullscreen()&&e[i.requestFullscreen]()},n.exitFullscreen=function(){n.supportsFullscreen()&&document[i.exitFullscreen]()},n}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,r,t){"use strict";function i(e){for(var r=e.split("."),t=0,i=r.length;i>t;++t)r[t]=parseInt(r[t],10);return r}function n(){if(!r(p)){p=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,y=i(e[1]))}return p}function o(){return n()&&y}function a(){if(!r(q)&&(q=!1,!n()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(q=!0,v=i(e[1]))}return q}function u(){return a()&&v}function s(){if(!r(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,E=i(e[1]),E.isNightly=!!e[2])}return g}function f(){return s()&&E}function c(){if(!r(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,b=i(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,b=i(e[1])))}return x}function h(){return c()&&b}function w(){if(!r(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,M=i(e[1]))}return S}function d(){return r(O)||(O=/Windows/i.test(navigator.appVersion)),O}function l(){return w()&&M}function m(){return r(_)||(_=r(window.PointerEvent)&&(!r(window.navigator.pointerEnabled)||window.navigator.pointerEnabled)),_}var p,y,q,v,g,E,x,b,S,M,O,_,z={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:u,isWebkit:s,webkitVersion:f,isInternetExplorer:c,internetExplorerVersion:h,isFirefox:w,firefoxVersion:l,isWindows:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3),supportsPointerEvents:m};return z.supportsFullscreen=function(){return t.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,r,t,i,n){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return o.getSizeInBytes=function(e){if(!r(e))throw new t("value is required.");switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new t("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return r(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,i){if(!r(e))throw new t("componentDatatype is required.");if(!r(i))throw new t("valuesOrLength is required.");switch(e){case o.BYTE:return new Int8Array(i);case o.UNSIGNED_BYTE:return new Uint8Array(i);case o.SHORT:return new Int16Array(i);case o.UNSIGNED_SHORT:return new Uint16Array(i);case o.FLOAT:return new Float32Array(i);case o.DOUBLE:return new Float64Array(i);default:throw new t("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(i,n,a,u){if(!r(i))throw new t("componentDatatype is required.");if(!r(n))throw new t("buffer is required.");switch(a=e(a,0),u=e(u,(n.byteLength-a)/o.getSizeInBytes(i)),i){case o.BYTE:return new Int8Array(n,a,u);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,u);case o.SHORT:return new Int16Array(n,a,u);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,u);case o.FLOAT:return new Float32Array(n,a,u);case o.DOUBLE:return new Float64Array(n,a,u);default:throw new t("componentDatatype is not a valid value.")}},n(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var r={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(r)}),define("Core/PrimitiveType",["./freezeObject"],function(e){"use strict";var r={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,r,t,i,n){"use strict";var o=function(o){if(o=e(o,e.EMPTY_OBJECT),!r(o.attributes))throw new t("options.attributes is required.");this.attributes=o.attributes,this.indices=o.indices,this.primitiveType=e(o.primitiveType,n.TRIANGLES),this.boundingSphere=o.boundingSphere,this.geometryType=e(o.geometryType,i.NONE),this.boundingSphereCV=void 0};return o.computeNumberOfVertices=function(e){if(!r(e))throw new t("geometry is required.");var i=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&r(e.attributes[n])&&r(e.attributes[n].values)){var o=e.attributes[n],a=o.values.length/o.componentsPerAttribute;if(i!==a&&-1!==i)throw new t("All attribute lists must have the same number of attributes.");i=a}return i},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,r,t){"use strict";var i=function(i){if(i=e(i,e.EMPTY_OBJECT),!r(i.componentDatatype))throw new t("options.componentDatatype is required.");if(!r(i.componentsPerAttribute))throw new t("options.componentsPerAttribute is required.");if(i.componentsPerAttribute<1||i.componentsPerAttribute>4)throw new t("options.componentsPerAttribute must be between 1 and 4.");if(!r(i.values))throw new t("options.values is required.");this.componentDatatype=i.componentDatatype,this.componentsPerAttribute=i.componentsPerAttribute,this.normalize=e(i.normalize,!1),this.values=i.values};return i}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var r=function(r){r=e(r,e.EMPTY_OBJECT),this.position=r.position,this.normal=r.normal,this.st=r.st,this.binormal=r.binormal,this.tangent=r.tangent,this.color=r.color};return r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math"],function(e,r,t,i){"use strict";var n={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};return n.getSizeInBytes=function(e){switch(e){case n.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case n.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case n.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new r("indexDatatype is required and must be a valid IndexDatatype constant.")},n.validate=function(r){return e(r)&&(r===n.UNSIGNED_BYTE||r===n.UNSIGNED_SHORT||r===n.UNSIGNED_INT)},n.createTypedArray=function(t,n){if(!e(t))throw new r("numberOfVertices is required.");return t>i.SIXTY_FOUR_KILOBYTES?new Uint32Array(n):new Uint16Array(n)},n.createTypedArrayFromArrayBuffer=function(t,n,o,a){if(!e(t))throw new r("numberOfVertices is required.");if(!e(n))throw new r("sourceArray is required.");if(!e(o))throw new r("byteOffset is required.");return t>i.SIXTY_FOUR_KILOBYTES?new Uint32Array(n,o,a):new Uint16Array(n,o,a)},t(n)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,r,t,i,n,o,a,u,s,f,c,h,w){"use strict";var d=new r(1,1,1),l=Math.cos,m=Math.sin,p=function(e){e=i(e,i.EMPTY_OBJECT);var t=i(e.radii,d),n=i(e.stackPartitions,10),a=i(e.slicePartitions,8),u=i(e.subdivisions,128);if(1>n)throw new o("options.stackPartitions cannot be less than 1");if(0>a)throw new o("options.slicePartitions cannot be less than 0");if(0>u)throw new o("options.subdivisions must be greater than or equal to zero.");this._radii=r.clone(t),this._stackPartitions=n,this._slicePartitions=a,this._subdivisions=u,this._workerName="createEllipsoidOutlineGeometry"};p.packedLength=r.packedLength+3,p.pack=function(e,t,a){if(!n(e))throw new o("value is required");if(!n(t))throw new o("array is required");a=i(a,0),r.pack(e._radii,t,a),a+=r.packedLength,t[a++]=e._stackPartitions,t[a++]=e._slicePartitions,t[a]=e._subdivisions};var y=new r,q={radii:y,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,t,a){if(!n(e))throw new o("array is required");t=i(t,0);var u=r.unpack(e,t,y);t+=r.packedLength;var s=e[t++],f=e[t++],c=e[t++];return n(a)?(a._radii=r.clone(u,a._radii),a._stackPartitions=s,a._slicePartitions=f,a._subdivisions=c,a):(q.stackPartitions=s,q.slicePartitions=f,q.subdivisions=c,new p(q))},p.createGeometry=function(r){var i,n,o,d,p,y,q=r._radii,v=a.fromCartesian3(q),g=r._stackPartitions,E=r._slicePartitions,x=r._subdivisions,b=x*(g+E-1),S=b-E+2,M=new Float64Array(3*S),O=c.createTypedArray(S,2*b),_=0,z=new Array(x),I=new Array(x);for(i=0;x>i;i++)o=h.TWO_PI*i/x,z[i]=l(o),I[i]=m(o);for(i=1;g>i;i++)for(d=Math.PI*i/g,p=l(d),y=m(d),n=0;x>n;n++)M[_++]=q.x*z[n]*y,M[_++]=q.y*I[n]*y,M[_++]=q.z*p;for(z.length=E,I.length=E,i=0;E>i;i++)o=h.TWO_PI*i/E,z[i]=l(o),I[i]=m(o);for(M[_++]=0,M[_++]=0,M[_++]=q.z,i=1;x>i;i++)for(d=Math.PI*i/x,p=l(d),y=m(d),n=0;E>n;n++)M[_++]=q.x*z[n]*y,M[_++]=q.y*I[n]*y,M[_++]=q.z*p;for(M[_++]=0,M[_++]=0,M[_++]=-q.z,_=0,i=0;g-1>i;++i){var T=i*x;for(n=0;x-1>n;++n)O[_++]=T+n,O[_++]=T+n+1;O[_++]=T+x-1,O[_++]=T}var N=x*(g-1);for(n=1;E+1>n;++n)O[_++]=N,O[_++]=N+n;for(i=0;x-2>i;++i){var P=i*E+1+N,R=(i+1)*E+1+N;for(n=0;E-1>n;++n)O[_++]=R+n,O[_++]=P+n;O[_++]=R+E-1,O[_++]=P+E-1}var A=M.length/3-1;for(n=A-1;n>A-E-1;--n)O[_++]=A,O[_++]=n;var C=new f({position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:M})});return new u({attributes:C,indices:O,primitiveType:w.LINES,boundingSphere:e.fromEllipsoid(v)})},p}),define("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,r,t,i,n){"use strict";var o=function(t){var i=r(t.radius,1),o=new e(i,i,i),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"};o.packedLength=n.packedLength,o.pack=function(e,r,o){if(!t(e))throw new i("value is required");n.pack(e._ellipsoidGeometry,r,o)};var a=new n,u={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(r,i,s){var f=n.unpack(r,i,a);return u.stackPartitions=f._stackPartitions,u.slicePartitions=f._slicePartitions,u.subdivisions=f._subdivisions,t(s)?(e.clone(f._radii,u.radii),s._ellipsoidGeometry=new n(u),s):(u.radius=f._radii.x,new o(u))},o.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},o}),define("Workers/createSphereOutlineGeometry",["../Core/defined","../Core/SphereOutlineGeometry"],function(e,r){"use strict";return function(t,i){return e(i)&&(t=r.unpack(t,i)),r.createGeometry(t)}})}();